core: Fix various layer context lock related deadlock scenarios
core: Fix various layer context lock related deadlock scenarios

Changed dfb_layer_context_get_primary_region to return the error
DFB_TEMPUNAVIL if the primary region is being destroyed.
Previously in this scenario (which means the primary region's
reference count was zero and there was not a request to create a
new one), a deadlock could occur involving the layer context lock
when the primary region was being destroyed by the main thread
(single-app mode), the Fusion Loop thread (multi-app mode), or
any other thread (such as linux_input thread that triggers the
window stack input processing) is trying to get the primary
region.  In addition, object_reference_watcher would be called
more than once when the reference count changes from 1 to 0
again in the implementation.

Patch by: From: Timothy Strelchun <Timothy.Strelchun@Intel.Com>

mtsekm/test,djbclark/directfb-core-DirectFB,lancebaiyouview/DirectFB,jcdubois/DirectFB,sklnet/DirectFB,kevleyski/directfb,DirectFB/directfb,lancebaiyouview/DirectFB,jcdubois/DirectFB,sklnet/DirectFB,mtsekm/test,dfbdok/DirectFB1,deniskropp/DirectFB,lancebaiyouview/DirectFB,mtsekm/test,kevleyski/DirectFB-1,deniskropp/DirectFB,kevleyski/directfb,deniskropp/DirectFB,sklnet/DirectFB,kaostao/directfb,Distrotech/DirectFB,kaostao/directfb,kevleyski/DirectFB-1,Distrotech/DirectFB,dfbdok/DirectFB1,kevleyski/DirectFB-1,kevleyski/directfb,Distrotech/DirectFB,sklnet/DirectFB,lancebaiyouview/DirectFB,jcdubois/DirectFB,dfbdok/DirectFB1,deniskropp/DirectFB,kaostao/directfb,kevleyski/DirectFB-1,djbclark/directfb-core-DirectFB,djbclark/directfb-core-DirectFB,DirectFB/directfb,DirectFB/directfb,djbclark/directfb-core-DirectFB,kevleyski/directfb