dis/reconnect socket when application is sent to fore/background
The SDK detects whenever the host app is sent to background, stopping the HEARTBEAT and background queue emitter timers. These timers are then re-started when the app is brought back to the foreground. We should ensure the socket connection is properly closed and reconnected upon these events too.