Fix close button event binding in save dialog

Fixes #1713