If an applications sets the no-screen/system-sleep flag, and then crashes, the flag remains set, even though the app which originally needed it, then does not run anymore!
Therefore the more stable approach is, to let the affected application trigger a user/activity event every here and then.