shutting down the prolog engine executor before closing the application