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. This allows errors to
throw a GWFrames_WaveformMissingLMIndex instead of a segfault.