cross-platform locking

by using a socket port as a lock indicator.
remove leftovers from the old file-based locking