The diff between compared timestamps might be outside the gint range resulting in wrong sorting results. This patch corrects that by comparing the timestamps and then returning -1, 0 or 1 depending on the result. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7726>