Add incomplete-character smarts to StringIO#gets + other tweaks.

* Add incomplete character logic to StringIO#gets.
* Move incomplete character logic to common place for
  StringIO#gets and GZipReader#gets.
* Untag passing StringIO#gets test.
* Fixes #563.