MainForm.cs: properly call Dispose() on modally shown forms (i.e. using the ShowDialog method)