Fix sql of AnormIndex.getTracesDuration to get right duration.

If I understand correctly, `Index.getTracesDuration` should return the duration of the entire trace. But current implementation of `AnormIndex.getTracesDuration` returns a span's duration rather than a trace's one. Because of this, `QueryService` can't sort correctly by duration.