egl/display: make platform detection thread-safe