stream: use setsockopt to set timeouts on sockets.