avcodec/pthread_frame: fix setting hwaccel with threads and get_format()

Fixes assertion failure with vdpau and vlc
Fixes Ticket3742

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