avg_ts_offset may cause division by zero when calculating potential overflow protection. This fix will avoid the division. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2151>