Added segmented M4A and MP3 writing for MOV export

Also fixed a few unfounded warnings about resource leaks