ffplay: ensure the decoder is flushed before exiting or looping

Also make sure that we only exit or restart the video if it is not paused and
if the picture queue is empty.

There is still room for improvement (filters may also buffer some frames), but
the patch fixes the most common use cases and ticket #2783 as well.

Signed-off-by: Marton Balint <cus@passwd.hu>
