Support .pc file without a trailing newline

Some editors write text files without a newline character at the end of
the last line.

Before this change, the main loop in pkg_new_from_file() expected a
newline character at the end of the line and overwrote it with a NUL
character. In the case of the last line in a non-newline-terminated
file, this ate the last character of that line.

Now, the pkg_fgetline() function takes care of returning a line without
the newline character (or the "\r\n" sequence in case of a DOS file
format).