Bug 730211 - Extra zeroes appear in XCF files (draft)

Patch to solve bug 730211. GIMP can be built with it and a simple
test to save and load "layers recovered.xcf" passes.
Needs further review and extensive testing as proposed by Massimo 
in comment 14 of the bug report.