tsparse: Fix handling of pending_buffers list in some cases

Fix potential corner-case crashes when there are no pending buffers.

Also set the DTS on outgoing buffers.
tsparse: Handle backward and discont timestamps better.

Assume that small backward PCR jumps are just from upstream packet
mis-ordering and don't reset timestamp tracking state - assuming that
things will be OK again shortly.

Make the threshold for detecting discont between sequential buffers
configurable and match the smoothing-latency setting on tsparse
to better cope with data bursts.