libhb: fix hang that can occur under certain error conditions
audio and video sync are in wait loops when they first start.
if an error happens during this period, the hang would happen.
check w->done in these loops to break out in case of error.


git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5592 b64f7644-9d1e-0410-96f1-a4d463321fa5