Use sleep/wake for idle detection too. Fixes #923 (lib)