Reinitialize threads on reset.

This fixes random crashes in worker threads if the codec is reset.