[PATCH 5/7] wined3d: Make reference count decrementing functions thread safe.