In my opinion IPC between Renderer and ApplicationProcessManager is not needed at all.

1. When web application is closed (OnPageClose), renderer will notify RWH that page is closed. 
2. Runtime::CloseContents would be called
3. Runtime::CloseContents closes aura window that is hosting contents
4. When window is closed, Runtime::OnWindowDestroyed will be called and it calls Runtime::Close
5. Runtime::Close deletes itself, therefore unregisters itself from the runtime registry
6. ApplicationProcessManager which is observer for the registry, can close main runtime when registered runtimes count is 1.

This part is handling Runtime lifecycle that is handling web app.

As for the main runtime, you could do 2 things.
1. Just close it when it is the last runtime that hosting web app is closed.
2. Implement proper check that will guarantee that main runtime is not doing anything.

As an example, just think about chat application. In main runtime (event page) we are polling data using web sockets and when there is a new message, we show notification and open new window that shows chat web app. When chat view is closed, we will have main runtime that is still working and watching for new messages.

With your patch, you will close main runtime, while you should not, since it is still running and functional.