Set the device lock state properly on startup