ffmpeg: use isatty() before messing with the terminal state

This fixes terminal messup in case of crashes (like in make fate)

Reviewed-by: François Revol <revol@free.fr>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
