fix case where IO#gets blocks forever on read to char boundary
fix case where IO#gets blocks forever on read to char boundary

This was a tough one. WEBrick would hang when reading an HTTP
header. The cause was that IO::EachReader#read_to_separator_with_limit
blocked forever trying to "peek ahead" to ensure we are reading
to the end of a proper character boundary. In this case the socket
had no more data to recv but it also does not set EOF, therefore
the read blocked indefinitely. The simple fix was to move to a
non-blocking read and skip the read entirely if the string
already had a valid encoding. However, this broke several specs
for reading multi-byte chars. To resolve that problem required
making sure that when read_nonblock returned an empty buffer that
this buffer was set to ASCII_8BIT instead of whatever the default
external coding was set to (usually UTF-8). The fixes are all
relatively simple but it took many hours to chase this down and
figure out the minimal approach to fix it.

kachick/rubinius,kachick/rubinius,kachick/rubinius,kachick/rubinius,kachick/rubinius,kachick/rubinius,kachick/rubinius,kachick/rubinius