workaround possible memleak in glXDestroyContext by releasing context before
fix bug in handle_acquire, returned non-NULL pointer to destroyed object
fix double mutex unlocking in presentation_thread()
use cond_mutex to avoid broadcasting condition before it initialized