avformat/wavdec: Fix reading files with id3v2 apic before fmt tag
Up until now the cover images will get the stream index 0 in this case,
violating the hardcoded assumption that this is the index of the audio
stream. Fix this by creating the audio stream first; this is also in
line with the expectations of ff_pcm_read_seek() and
ff_spdif_read_packet(). It also simplifies the code to parse the fmt and
xma2 tags.
Fixes #8540; regression since
f5aad350d3695b5b16e7d135154a4c61e4dce9d8.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>