Fix lock set and remove
When setting a new lock from the same application, try to concatenate
the new lock with the existing ones.