Recap: hostnames are often not unique. When detecting stale locks this is required however. It would be good to augment the hostname with something which is usually unique.
Earlier discussion:
#1246 (comment)
Also #562 as the "master issue" regarding locking.