checks: fix flacdec unit tests on big-endian machines and under valgrind
Flacdec outputs 16-bit samples, so let's check if the value of the first sample is what we expect rather than just the first byte, which may be different from what we expect depending on the host's endianness. Fixes the flacdec unit tests on PPC. Also fix a bunch of leaks in the unit tests to make valgrind happy. Fixes #582420.