Fix warnings on invalid model indexes on startup
Various legend codepaths want to look up static metadata about a sensor. We have this populated on startup potentially before any rows are inserted into the model.
Calling data on an invalid index is a illegal, fortunately all of this information is available in the header data before we have any rows.
Testing done: On the default history page I still have units and my stacked CPU core graph correctly, but with less stderr