Deinitialize Python-based dockers when the last document is closed
This patch changes API of python-based dockers a bit. Now canvasChanged()
can be called with null canvas, which means all (or the current) document
was closed and the docker should deinitilize itself