Fix test setup so close on the output stream also closes the socket

Per Socket#getOutputStream(): Closing the returned OutputStream will
close the associated socket.