fix the (hackish) context swapping

although calling avcodec_close looks even more wrong.
complete the muxer tests

restore 100% coverage.