Add NUL terminator to allocated memory.

I zeroed out the allocated memory block so that both partial and full
reads are NUL-terminated.
Merge pull request #32 from jbcrail/nul-terminate

Add NUL terminator to allocated memory.