Add more support for different versions of libmagic.

See commit fe9d7056112d027c140bf0efd4f43577b102c28e.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>