Remove use of locals() when creating messages

Per the hacking guidelines locals() should not be used when creating
messages, but additionally this is preparation for upcoming message
internationalization work.

Change-Id: I9ce616b94faf2d7df895c6bffb94baac8c82c7ce
Merge "Remove use of locals() when creating messages"