Fix a bug where discardStream took way too long.

We were relying on the socket timeout of a single read,
but performing multiple reads each with independent
timeouts.