Bug 676270 - cppcheck report

Fix a couple of harmless stuff pointed out in the report, and one
real bug: gimp_plug_in_close() was killing each process 10 times
on windows.

(cherry picked from commit 47c987b09e21b460e3d7f5c9e706ffaef4f198a3)

Conflicts:
	app/actions/image-actions.c
initialize length to appease cppcheck

The code was technically correct previously: It wrote the uninitialized
length only as a placeholder to overwrite it later on. Yet it's better
to not confuse tools (or people) analysing the code. Besides that having
0 for the length in the file while the payload is being written may aid
debugging e.g. crashes in that code later on.

(cherry picked from commit 2e6af22686cba732a10dce3a066349083a4f1498)