Sanitize Record._elements (backport #3419) (#3426)

* Sanitize Record._elements (#3419)

This moves name sanitation a little earlier and ensures that the
sanitized names are use more consistently throughout Chisel internals.

This fixes a bug in D/I where unsanitary names would lead to a crash.

(cherry picked from commit 5c282db5)

* Keep Scala 2.12 support by not using VectorMap

* Fix firrtl in tests for older firrtl spec version

---------

Co-authored-by: Jack Koenig <koenig@sifive.com>
8 jobs for 3.6.x
in 0 seconds and was queued for 107 minutes and 11 seconds