Waveforms.cpp: prevent a segmentation fault

If there are fewer modes than expected, will not try to access
elements of member lm that do not exist.