Fix error check when reading from file.

The return value of read() could differ from the requested byte count,
which is not an error condition.  Check for negative return values
instead and continue until EOF.
Merge pull request #21 from acolomb/fix-read-bytes

Possible fix for premature read() error #20