On the magnetic fields of ultraluminous X-ray pulsars