mac: Clean delegate after closing window