lavc: Move the libtwolame encoder registration to the list for external libraries

This makes sure the default behaviour of using the internal encoder
stays the same regardless if libtwolame is enabled or not (as for
any external library).

This fixes fate-lavf-mpg if libav is built with libtwolame enabled.

CC: libav-stable@libav.org
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
xwma: Do not leak on failure path

CC: libav-stable@libav.org
Bug-Id: CID 1087092
lavfi: clean memory on error in ADD_FORMAT()

CC: libav-stable@libav.org
Bug-Id: CID 1250334
Merge commit 'aa8b39d999589154f79300de9038994d0093cd34'

* commit 'aa8b39d999589154f79300de9038994d0093cd34':
  lavc: Move the libtwolame encoder registration to the list for external libraries

Conflicts:
	libavcodec/allcodecs.c

See: f5f98727b361c62d3962cef37a100db95d62b702
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6'

* commit 'fd9badd3cb3b60f5c54dcea35523e1ecca2f67a6':
  xwma: Do not leak on failure path

Conflicts:
	libavformat/xwma.c

See: 375a0c03a9a401a328a94b3d9f5338ab1524f7ef
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '863ee8a855b8ce27ffef41479eb66da58763faed'

* commit '863ee8a855b8ce27ffef41479eb66da58763faed':
  lavfi: clean memory on error in ADD_FORMAT()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
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>
avfilter/formats: Alloc NULL fmts in SET_COMMON_FORMATS()

This avoids null pointer dereferences in case memory allocation has failed

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