Use the nearest monitor when the search query rect does not intersect any monitor (Fix bug 5500)
Previously we would try to find the primary monitor and use that when the search
was outside any monitor. However, if the primary monitor is chosen by the mouse
position and the mouse is not inside any monitor, we enter infinite recursion
trying to find the primary monitor.
The nearest monitor is a better metric anyhow, and this ensures
screen_find_monitor() is never recursive as it always returns a value without
depending on other screen.c methods.