Fix connect Null Pointer Exception, threads not synchronized with class result as transport = null in some cases.
Synchronizing all methods using transport.
Merge pull request #1 from tijee/bug/fix-connect

Fix connect Null Pointer Exception, threads not synchronized with class ...