Prevent background agent running when app is in foreground