core/window: Do not rely on Monitor Numbering
When the monitors change meta_window_update_for_monitors_changed is called which is responsible for updating window->monitor. It however can go through the entire window placement and constraint machinery before it's able to do so. In this period window->monitor points to the old MetaMonitor where the monitor number doesn't reflect the index into the MonitorManager anymore.
Avoid relying on the window->monitor->number and go through the Monitor directly.
Closes: #3402 (closed)