net_http.rb: StubSocket needs read_timeout for aws-sdk

Sorry that I failed to find out how to reproduce this in a simple
way without using aws-sdk, ending up with Net::WebMockNetBufferedIO
instead of StubSocket. aws-sdk is maintaining a connection pool which
is too complicated and I am tired of digging into it. Time to sleep...

Thanks!
Fix #to_rack to handle non-array response bodies.

When using #to_rack with a Rails endpoint, such as:

  stub_request(:any, %r{api.example.com/.*}).to_rack(Rails.application)

...you receive the following error:

  NoMethodError: undefined method `join' for #<ActionDispatch::Response:0x007ffd06e6f540>

Turns out ActionDispatch::Response is in the right. A Rack response body
is only required to implement #each, not #join.

This patch fixes #to_rack to build the body using the #each method.
Merge pull request #150 from thunderboltlabs/master

Fix #to_rack to handle non-array response bodies.
Merge pull request #149 from godfat/read_timeout

net_http.rb: StubSocket needs read_timeout for aws-sdk
Upgraded dev dependencies to lastest Patron 0.4.17 and updated patron adapter spec to match changes in behaviour.
Upgraded dev dependencies: Typhoeus to 0.3.0 and HTTPClient to 2.2.4
Fixed compatibility with Curb >= 0.7.16 This breaks compatibility with Curb =< 0.7.15
Changed default em-http-request version dependency to >= 1.0.0. Specs against version 0.3.0 run on travis too.
Fixed em-http-requests specs to be compatible with latest changes in em-http-request.
Increased connection timeouts in specs for travis environment
Ensured alphabetical order of body presented as a hash in error message
Patron is a development dependency but not in JRuby
Typhoeus is a development dependency but not in JRuby
Removed JRUBY_OPTS from travis config
Increased open and read timeouts in Net::HTTP adapter specs
Fix "warning: instance variable @query_params not initialized" warning
Fixed a Rack::Lock bug around failing to close the response body
em_http_request_1_x: use bytesize of message instead of its length for content-length header

In rubies 1.8.x this will have no effect whatsoever
In rubies 1.9.x this fixes problem of receiver's message getting truncated
   (since some utf-8 characters are more than 1 byte long)
Fix #globally_stub_request to support multiple global stubs.

Previously it didn't fully support this (but didn't prevent it either) and it had weird ambiguities.  This cleans the code up a bit, too.
Ensure that global stubs take precedence over non-global stubs.

This is important for tools like VCR that use global stubs for more than just returning a stubbed response--for consistency, it needs to always have the stub block invoked so it can manage before/after request hooks.