Libmonkey: Fix a bizarre segmentation fault at libstats unload

Apparently, an application with multiple threads or child processes
can cause a call to libstats destructor many times. Avoid closing
multiple times the same library handler.

Signed-off-by: kaspersky <gg.kaspersky@gmail.com>