Fix: closing of sessions weren't being tracked sometimes

In some situations, `applicationDidEnterBackground:` wasn't executed.
We've switched to `applicationWillResignActive:` and also moved the crucial code to the beginning of the method.

Signed-off-by: Miguel M. Almeida <miguelcma@CMA-Retina.local>
Event, Session and DPoint dates tracked outside the queue

In Sessions, Events and DataPoints:

* `[NSDate new]` was being calculated inside the queued thread.
* We've moved this code to the outside of the block.

Signed-off-by: Miguel M. Almeida <miguelcma@CMA-Retina.local>