Workaround for saving chunks in old libpng versions

Fixes #37