How to allow or disallow program shutdown in Delphi