Add check to ensure we don't shutdown too close to a wakeup