avcodec/utils: fix sizeof(AVFrame) dependence in  avcodec_encode_audio2()

This is a bit tricky, we allocate a correctly sized AVFrame but then only
copy the compile time AVFrame size, this is to ensure that user applications
which do not use the correct av frame API dont end with out of array reads.
Note, applications using the correct API have set extended_data and the
changed code will never be executed for them.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>