forgot to init/free lock
Merge branch 'use_sigwait' into port_osx