socket process lock (fixes #411)