Fix errors from commit f0a169e.
Fix errors from commit f0a169e.

- fread() returns the number of items read.
- fix a memory leak in error handling.

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1135713004

bradh/pdfium,azunite/libpdfium,rouault/pdfium,pwaller/pdfium,chenjian-rits/HelloWorld,was4444/pdfium,DrAlexx/pdfium,DrAlexx/pdfium,wwxxyx/pdfium0,klokantech/pdfium,klokantech/pdfium,chenjian-rits/HelloWorld,rouault/pdfium,azunite/libpdfium,andoma/pdfium,pwaller/pdfium,azunite/pdf_clone,azunite/libpdfium,bradh/pdfium,andoma/pdfium,andoma/pdfium,DrAlexx/pdfium,was4444/pdfium,nathanstitt/pdfium,wwxxyx/pdfium0,pwaller/pdfium,bradh/pdfium,azunite/pdf_clone,andoma/pdfium,klokantech/pdfium,was4444/pdfium,nathanstitt/pdfium,chenjian-rits/HelloWorld,rouault/pdfium,azunite/libpdfium,nathanstitt/pdfium,azunite/pdf_clone,was4444/pdfium,wwxxyx/pdfium0,DrAlexx/pdfium