wined3d: Improve render target locking.