libav*: create a new avcommon_compat.h file for backward compatibility

This patch includes necessary defines
Avcodec: create replacements for older versions of lavc

Methods avcodec_alloc_context3, avcodec_open2 and error_recognition
member
Partial revert of "avcodec: remove support for old versions"

This partially reverts and adapts commit cde81e52f2d6e17383aced57fe6312eafa79cacf.
This is mostly related to Palette and Options

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Configure: allow older versions for libavcodec
Configure: vaapi and vdpau need avcodec

Should fix distcheck