avformat/img2dec: Support -loop with pipes

Fixes Ticket3976

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>