Treatment of the charge-independent pairing Hamiltonian without violation of conservation laws