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
Merge branch 'master' into next

* master:
  gbm: lock and release buffer in swap buffers