We need to pass the socket to the connect function.

The keep alive thread does try to delete the socket it gets
from the connect method, but since the socket was created in
a different thread and we will hit the:
"Socket notifiers cannot be disabled from another thread" warning.

Change-Id: Ibafcd67f8cdb51b365c3ef230f1ebd447bdd306a
Reviewed-by: Niels Weber <niels.weber@digia.com>
Fix some reorder warnings

Change-Id: I714224c5616d40c5f36598a4682a07dfa0ff7136
Reviewed-by: Kai Koehne <kai.koehne@digia.com>