Add a timeout to the stream connection.

The default timeout is too long for our purpose. This mod should probably be
ported in upstream.