Use the 'with' syntax with the libclangLock.

This removes the .acquire() and .release(), and avoid potential lockups if the code wasn't guarded by try catch.