Fix crash in ns_mouse_position (bug#44313)
* src/nsterm.m (ns_destroy_window): Close the window before freeing the frame resources so we don't end up accessing the frame struct after it's been freed.
* src/nsterm.m (ns_destroy_window): Close the window before freeing the frame resources so we don't end up accessing the frame struct after it's been freed.