Make sure lua-callable functions take the locks they need.