Wait for greetings data to arrive

Previously, if greetings data was not immediately readable from the
opened socket, the connection failed because only partial greetings were
received.
Merge pull request #5 from anttihirvonen/connection-greetings-fix

Problems with TCP packets