macos: fix window stacking
This improves the window stacking a bit where we could otherwise get into a situation where a window with a transient-for is stacked completely beneath it. Extra bad when that parent was modal.
This was an easy situation to get into with the icon browser.