Use locking to prevent doc update conflicts on kookoo requests

@czue i guess i didn't have to take the return out of it according to http://stackoverflow.com/questions/9885217/if-i-return-inside-a-with-block-is-the-file-guaranteed-to-close