Fix FileDialog lifetime bug from issue #217