matroskadec: introduce resync function.

This allows handling matroska files with errors.
Fixes test4.mkv and test7.mkv from the official Matroska test suite,
and by extension Bugzilla #62.

Based on a patch by Reimar Doffinger <Reimar.Doeffinger@gmx.de>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
lavc: use AVFrame API properly in pad_last_frame().

This also simplifies the code.
lavc: add a libwavpack encoder wrapper