make png write happen on write() rather than in destructor
make png write happen on write() rather than in destructor

libpng buffers data until png_write_end is called. delaying writing that
to the file until the destructor causes fun race conditions as things go
out of the parent scope, sometimes causing the data to go away before it's
actually written to the file.

also, doing it in the destructor makes it pretty dang hard to avoid
throwing an exception out of a destructor.

DougFirErickson/visionworkbench,DougFirErickson/visionworkbench,AveRapina/visionworkbench,fengzhyuan/visionworkbench,fengzhyuan/visionworkbench,AveRapina/visionworkbench,DougFirErickson/visionworkbench,DougFirErickson/visionworkbench,AveRapina/visionworkbench,AveRapina/visionworkbench,fengzhyuan/visionworkbench,fengzhyuan/visionworkbench,DougFirErickson/visionworkbench,fengzhyuan/visionworkbench,fengzhyuan/visionworkbench,AveRapina/visionworkbench,AveRapina/visionworkbench,fengzhyuan/visionworkbench,DougFirErickson/visionworkbench