[Bug  #1074851] Fix a few memory leaks.

The largest leaks were in the Flood Tool and the Finish Pixels history
item.