Fix a crash bug in BeforeRun()

The mouse update function uses a _form field after it has been
disposed, resulting in a NRE. This PR ensures that disposed Forms are
correctly removed from the list of windows, which prevents the crash.