Global optimization of nonlinear least-squares problems by branch-and-bound and optimality constraints