Fixed range check in fgetln when realloc()ing

- Segfaults were happening on Solaris when realloc()ing the buffer,
  presumably after writing an extra byte past the allocated memory and
  corrupting the heap