Fix another edge case bug with Display.setParent() on OS X. Thx to
ihkbob for providing test case to reproduce it.