Bring back the KeepAliveThread, fixes unexpected hang.

Change-Id: I253e1f2b8f8032ec14a65f1748878b4a4f1a7ae5
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>