xprograms: add functions for locking on sleep