sweep2wake: redesign wakelocks

Only wakelock if necessary and release the wakelock immediately if not.