I'm not sure how to stop them getting out of sync, but when I run into that problem I find that
Avidemux is a simple tool for getting them back in sync. All you have to do is open the file and enter the number of milliseconds that you want the audio advanced or delayed by.
Beyond that, I'd suggest using Avimedux for the conversion itself. It will save you from having to use multiple programs.