Release all the tile pools forcefully when a document is closed
This approach is a bit hackish, but it is the best thing we can do.
When the document is closed and the pool still contains a few tiles,
we artificially "swap-out" the tiles into a QList, purge the data in
the tile data pools and "swap-in" the tiles back.
Surely, we will not get an ACM award for this solution, but at least it
works ;)
CCBUG:364848