made client use blocking IO instead of nonblocking IO

I decided to not to crate a separate client implementation which uses blocking io but rather make the existing one blocking.

The changes are meant to simplify the implementation, and get rid of problems on android.

Currently everything should be working fine, except that its currently not possible to specify a connect timeout.
Before merging i will fix that and will do some more tests.

#139, #140, @leggetter

ps: It would be helpful to get some feedback if everything is working fine.