Fix variable scoping.

Refs #5846
Add missing locks.

Refs #5846
Add missing brace.

Refs #5846
Make it easier to call AExpression::Dump from GDB.

Refs #5846