possible fix to matplotlib tk disconnect