metadata: add libavcodec > 54 compatibility

libavcodec55 brings some API changes, including CodecID => AVCodecID.
Add a compatibility wrapper so we can build with libavcodec >= 55.
portability: add support for Illumos

This still won't work on older Solaris systems, but modern Illumos
at least should build and run now.
metadata: more libav10 compatibility changes

Add a couple more compatibility wrappers.
metadata: get embedded cover art from video files using libavformat

Newer version of libavformat can grab cover art, so we'll go ahead
and use it.  We also need to make sure we don't confuse cover art
with a normal video stream.
metadata: get rid of some unnecessary mallocs