Make diagram renderer (python bindings) more stable

Fix possible crash.
See http://hub.qgis.org/issues/7250#change-39023. (Run script twice)