fix Segfault in finalize which happens because we try to call completion callback function from yoda, but yoda already unloaded at that moment.
wait for outstanding request to complete before closing
Refs: 3763