Fix NPE and position bug with Display.setParent() on OS X