Add TVar-based locks to ensure "sudoed" stuff doesn't interfere with anything else.