Disconnect signals before closing the wizard.

[Closes #4817]
Merge remote-tracking branch 'refs/remotes/ivan/bug/4817_disconnect-signals-on-wizard-close' into develop