malloc+memset(0) to calloc

Hi, cleaned up.

 realloc thing was for the possibility of leak if the realloc fails and the copy is lost forever.

 Both av_malloc or av_mallocz in mem.c in ffmpeg was last changed in 2002. Libressl devs made a good case on practices of malloc calloc memset for both security and performance.