Don't destruct the MeshSerializer too early

This "warning fix" is an actual bugfix.  A corner case, but still
makes me feel better about wading through cppcheck output.
Pass strings by const reference
More cppcheck warnings fixes