Release wake lock as soon as we are authenticated

Trying to address the problems pointed out in issue #143. The main problem here is wake locks are too long-lived or too much. We can't
lower the number of wake locks, but we can do something to make them
shorter. This, however, puts the app in danger of losing the connection to the server when the device is put on standby.

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>
Merge branch 'master' into blockuser