swresample/resample: use av_malloc_array() where appropriate