Close temporary objects after closing persistent objects

Plugin is one of persistent objects. It may use temporary objects. If
we close persistent objects before closing temporary objects. We can't
use temporary objects in plugin finalizer.