fixed logging message
subproc: return pid of started process
subproc: added a further lock, comments and refactoring