Use all linker options from pkgconfig files, not just -l options

Static linking against libavcodec currently fails as we're dropping
the -pthread option.
Fix mem leak in dvsink-files.c

We would allocate space for a file name (so it could be printed out),
but that space was never deallocated.

While the impact should be minimal, leaking memory is never a good
thing.

Coverity CID#56306