loaders: PNM: Fix a few issues found by tests.
loaders: PNM: Fix a few issues found by tests.

* The fprintf() returns number of bytes not
  number of converted formatting chars, ouch.

* Fix errno propagation from read_header()

* The PBM has inverted the black and white
  but the PGM is normal again.

Signed-off-by: Cyril Hrubis <b1e90efd3b808b8e0bcf2a9a55fd8b9a779bfd81@ucw.cz>

gfxprim/gfxprim,gfxprim/gfxprim,gfxprim/gfxprim,gfxprim/gfxprim,gfxprim/gfxprim