Application stop bug fix

Fixed a problem where the application did not detach the internal events from it's callbacks registry when stopping.  This has the effect of calling the callbacks as many time as the application was started/stopped during the lifetime of an application.