refactored err.* to seperate error logging

this allows easy err_warn macro
improved the design of the unload api call

the unload api call now does its work in a newly
spawned and detached thread such that the plugin
can join its own threads in its aug_plugin_free
function without worrying about joining itself
(previously the calling thread was used to call
the aug_plugin_free function).

this indirectly fixed a memory leak in unload.c
(it was failing to join the thread it created).