Fix crash if tcl/tk is not properly installed.

This may happen if e.g. running test-cases with a incomplete Python
installation.