Partially revert "Simplify code by using av_metadata_set2()."

This reverts snprintf->av_d2str part of r20840.
With it, track number is exported as a float, which is not
desirable.

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