The Lipkin-Nogami formalism for the cranked mean field