Added explicit timeout handling to gen_tcp:recv calls mochiweb_http.
Added explicit timeout handling to gen_tcp:recv calls mochiweb_http.

Firefox was getting intermittent 400 errors after a period of inactivity
on persistent connections.  If the connection timed out just before
the request arrived a 400 was being sent by handle_invalid_request
and interpreted as the response by firefox.
Now it just closes the connection if no request is pending.

riak-synrc/mochiweb