macosx: fix crash when opening goto window (close #9488)