FFI: Refactor loading/unloading shared libraries
FFI: Refactor loading/unloading shared libraries

Get rid of manual reference counting and fix leak where dlclose is not
called if no symbols were successfully loaded

GaloisInc/cryptol,GaloisInc/cryptol,GaloisInc/cryptol