wayland-server: fix socket ownership race condition
wayland-server: fix socket ownership race condition

Always unlink() the lock file before closing the file
descriptor for it. Otherwise, there is a race like this:

Process A closes fd, releasing the lock
Process B opens the same file, taking the lock
Process A unlinks the lock file
Process C opens the same file, which now no longer exists,
and takes the lock on the newly created lock file

Process B and C both 'own' the same display socket.

unlink()ing while holding the lock is effectively a better
way to release the lock atomically.

tulcod/wayland,bitfactor/wayland,abooij/wayland,abooij/wayland,sir-murray/wayland,tulcod/wayland,bitfactor/wayland,sir-murray/wayland,eyolfson/wayland,mchalupa/wayland,bitfactor/wayland,tulcod/wayland,eyolfson/wayland,eyolfson/wayland,abooij/wayland,mchalupa/wayland,mchalupa/wayland,sir-murray/wayland