[PATCH 01/35] wined3d: Make reference count decrementing functions thread safe.