fix locking in exec_not_null{,_no_headers}
Merge pull request #1 from ygrek/master

fix locking in exec_not_null{,_no_headers}