Vulkan: Make ThreadSafeCommandQueue's wait without lock This CL makes all wait functions in ThreadSafeCommandQueue class to wait without holding the lock, so that other contexts can still submitting commands or make calls into CommandQueue. To make this work, Shared<Fence> has been refactored into SharedFence class which is RAII and manages refcounted VkFence object. It's copy constructor simply adds a reference to the underline fence object, so that the local copy of a SharedFence object guarantees underline vkfence will remain valid. RAII makes sure that local copy of SharedFence will not leak refcount. The ThreadSafeCommandQueue wait functions makes a local copy of SharedFence so that it can unlock and wait and then relock. This CL also adds a new test for this: EGLMultiContextTest.ThreadBCanSubmitWhileThreadAWaiting Bug: b/261106868 Change-Id: I96ecfa1d9f7a3dc646ff2287d789313a9f8fb75d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4159871 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>