libavfilter/af_amerge: fix segfault if init fails.
lavf/avio: check that the protocol supports the open mode.

Fix trac ticket #2139.
lavfi: fix merging of formats and clarify exception.

The following commit:
b97d61f avfilter/ff_merge_formats: only merge if doing so does not loose chroma or alpha
introduced an exception to avoid lossy conversions.
Add a comment to explain the logic.
Fix the call to avoid applying it on audio formats.
lavfi/formats: reindent after last commit.