Phase transitions and quasidynamical symmetry in nuclear collective models. II. The spherical vibrator to gamma-soft rotor transition in an SO(5)-invariant Bohr model