Let's actually properly check the output of dlclose

I have no clue why it is segfaulting really. It isn't that big of a deal
either really, as in most cases you'll only load shared libraries and
almost never unload them anyway. Still I would like to have this fixed.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>