uhd: Fix possible freeze-up when using lock/unlock (Solution by Johannes...

... Demel)