Integrability of the constrained rigid body