Read all remaining data before closing down the socket.
We run into this on windows with the resourceconfigtest.