Possibly fix pending connection (fix #244)

Signed-off-by: Daniele Ricci <daniele.athome@gmail.com>
Merge remote-tracking branch 'origin/master' into tigase