Fix for Cairo.Context error at the end of XWT application.