egl: Clean up and fix _eglLockDisplay
The fix is to take _EGLDisplay::Mutex before dropping the global mutex, since otherwise we leave a race window open. The rest of the change is removing some indirection that made things difficult to follow.
@robclark probably we want to fold this into !18050 (merged) and/or land this first.