sort graphs and lines by id when weight is not set

otherwise graphs or dashboards that have never been sorted would be
exported as json in a non-deterministic order which would lead to
reimporting json dashboards in a random order