unique_ptr and .close()