Convert locals() to real dict when recording transactions.