Weight loss can negatively affect bone health—but not with these science-backed tips.