add application run and stop hooks

Add R hooks for notification when applications run and stop. These hooks are principally useful to front-end environments. Two use-cases are:

1. Awareness that a busy console represents a long running sub-task (rather than an R command that happens to be taking a few seconds). Front ends might in this case want to treat their busy/stop UI a bit differently.

2. Implementing more sophisticated browser management. For example, a front-end could set shiny.launch.browser to FALSE and then launch and manage application browser using DDE, AppleScript, or DBus. A front-end could also implement their own shiny application browser container (with features like auto-reactivation, close-on-stop, and auto-refresh).