Fix CosaIOBuffer testing of gets()

As recommended by Mikael.