Better error checking and handling.

This is to address some of the things that libmagic does internally.

Where for instance closing an open Magic database results in allocated
structure being freed, and NULL and/or void pointer will not be assigned
back to the variable therefore all subsequent calls to any of the public
function expecting to access Magic database session via given handle
will result in accessing random bits of memory causing SIGSEGV to follow,
sadly. This is despite a lot of them checking whether pointer to the
Magic database is NULL or not as a precaution.

We make sure that this does not happen when using Go interface.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Re-factor some tests to make them better.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Add implementation for TestMagic_Version().

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Add example_test.go to show simple use cases.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Update README.md file.

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