Disconnect signals before closing the wizard.

[Closes #4817]