Various scenarios have been uncovered where unloading of the fasttrap module
would result in an assertion failure.
Essentially, what is going on is that an executable may register providers
for USDT probes (i.e. pass a DOF object to DTrace through the helper interface)
while there isn't any consumer active. Any attempt to remove the fasttrap
provider at this point in time causes an assertion failure on the reference
count for all providers instantiated by the the meta-provider (fasttrap),
because module removal cannot be stopped once it has been initiated.
The solution is to take a reference on the meta-provider module whenever a new
provider is instantiated in it, and to put the reference back when that
provider is retired (removed from use). I.e. the module will be listed as in
use as long as there are providers associated with it.
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>