Fixed crash when releasing wake lock in magnetic field sensor