[Bug 22624] multithread app using GDI and directx may cause deadlock