Free encoder extradata in avcodec_close(). Should fix several small memory
leaks when encoding (at least for asv, wma and aac).

Fix also issue 1577.

Originally committed as revision 21923 to svn://svn.ffmpeg.org/ffmpeg/trunk
