fixed more tcp connection issues

Ignore-this: 8ae7c0aa64888ae2de087fe04bb1c409

Fixed two bugs. one where adding a greeter first time fails.
two, where close function may try to close socket that already got destroyed

darcs-hash:20131114041538-c21fe-e38a54f45ad681cc7ce2c4f1555731e7f7761a2a