Make CfReadLine (potentially) dynamically allocate memory

This changes CfReadLine to work exactly like posix getline, except
that it does not include carriage return at the end.