Fixes IOS-249 Ensure background message fetch doesn't resurrect task queue

When an infinite background task is performing, the timers are still fired, so checkForMessages may be still be called. Simplest fix is to ensure we're not in the background before resurrecting the task queue and incurring a network and disk I/O hit.