aptMainLoop(): Add handling for APP_PREPARE_SLEEPMODE