Add global define for _DEFAULT_SOURCE and get rid of all defines in
source.
Allow to set managed pointer to the backend_surface
Replace busy loop with activity loop.