avfilter: dont write out of array for duplicate formats in avfilter_merge_formats()
Note, this is a theoretical fix, iam not aware of a case where this function receives
duplicates in its input.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
