calling shutdown on tcp socket before close

Ignore-this: 860797402e67e0338703e6ab903c3756

darcs-hash:20140112053723-c21fe-3e19b9d99b08fbb2d7387e39685f3393e3b1d698