Take the compiledir lock only if the op generate c code.
assert that the compile directory still exist.
Merge pull request #1197 from nouiz/lock

Take the compiledir lock only if the op generate c code.