Fix DialogProvider not freeing instances.

Previously it only released the instance if the window was closed by the user
interacting with it through the window manager, rather than if it was closed
programatically (through an OK/Cancel button, for example).

Change-Id: I07ef95ebf4e47279c027747b03c5adcd1b37eea4
Reviewed-on: http://gerrit.dmdirc.com/3091
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager