Function set_library
fn set_library(library: Option<Arc<SharedLibrary>>) -> Option<Arc<SharedLibrary>>
Sets the library instance stored in TLS and returns the previous library.
This functions allows for sharing library instances between threads.