Add specs for IO.gets with a limit

This adds specs for a limit that is bigger than the number of available
bytes. In that case all bytes should be read.
Also ensure to read final data if limit is reached

Before this change, the last piece of data read when a limit was given
was never yielded. This resulted in a nil return value of for example
IO.gets was used with a limit higher than the number of available bytes.

Fixes #2346