cross-platform locking

by using a socket port as a lock indicator.