wined3d: Perform sanity checks on the rectangle in LockRect.