application: fix the return annotation for mx_application_create_window
application: disconnect the window destroy handler when removing the window

Make sure the destroy handler does not attempt to remove the window from
the application after it has already been removed.