Add terminate method for closing pinentry
Raise exception when there is an error for asking confirmation