Fix a bug when generating for maps when no msgs are defined

This is an addition to 14df6bb, but when generating for maps instead
of records.
Prepare for 3.8