Tried not using a smart pointer for the opaque handle object
A close() function with a callback has been added.