Stack-allocate wxDialog instead of using wx_ptr.