tests: loaders: PBM, PGM, PPM, more tests.

Add more tests for the PNM image loaders.

Signed-off-by: Cyril Hrubis <metan@ucw.cz>
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 <metan@ucw.cz>
loaders: PNM: Implemented GP_SavePPM, GP_SavePNM

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