Setting a format does not automatically mean making a wav file.
Instead, check for the extension on the output file name and when we
can't find any good containet, use the same as the input file.
This makes more sense than doing `spa-resample test.flac -r 44100 test.wav`
and ending up with a FLAC file named test.wav. Or
`spa-resample test.flac -r 44100 -f s16 test2.flac` and ending up with a
wav file named test2.flac.
Also clamp the amount of input samples we push when flushing. do several
rounds of zero pushing until we have flushed enough.
Handle the cases where no input is needed or no output is generated.
Fixes crashes when downsampling from 96000 to 1000 Hz or so.