avfilter/formats: free the correct pointer in ADD_FORMAT()
Also only free it when it was not previously allocated to return to the state prior to the failing function call
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>