egl: move Null check to eglGetSyncAttribKHR to prevent Segfault