Force using a 64bit intermediate when calculating calendar time with av_timegm().

Fixes a fate failure with icc 13.1
Add dependencies for the aac encoding fate tests.
Add dependencies for the flac encoding fate tests.
Add dependencies for the voice fate tests.
Close output codecs if input codec initialisation fails.

Fixes ticket #1546 and the remaining part of ticket #1244.