egl: add preliminary wegl_platform

Will be used to store all the egl function pointers, in order to avoid
linking against libEGL.so.

v2: Update the Android build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
egl: retrieve the libEGL function pointers at wegl_platform_init()

Which will be used in our next step, to make libEGL free waffle.
Paving the way of waffle to have little to-no dependencies.

v2:
 - Use libEGL.so.1 for Linux and libEGL.so for Android.
 - Increase dlopen/dlsym error severity to WAFFLE_ERROR_FATAL.
 - Typo s/RETREIVE_EGL_SYMBOL/RETRIEVE_EGL_SYMBOL/

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
egl: drop explicit linking against libEGL.so

... by using the function pointers retrieved via dlsym() at
wegl_platform_init() time. This effectively allows waffle to be
distributed on systems that lack
the library.

v2: Drop the libEGL link from the Android build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
gbm: lock and release buffer in swap buffers

Otherwise mesa prints "libEGL debug: EGL user error 0x300d
(EGL_BAD_SURFACE) in dri2_swap_buffers" when environment
variable EGL_LOG_LEVEL=debug.

Fixes #17: https://github.com/waffle-gl/waffle/pull/17
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Merge branch 'maint-1.4'

* maint-1.4:
  gbm: lock and release buffer in swap buffers
Merge branch 'evelikov/drop-egl-linking'

* cooking/evelikov/drop-egl-linking:
  egl: drop explicit linking against libEGL.so
  egl: retrieve the libEGL function pointers at wegl_platform_init()
  egl: add preliminary wegl_platform