Add av_shrink_packet function for use in av_get_packet that reduces pkt->size
and ensures the following padding is correctly initialized to 0.

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