[Runtime] Implement onSuspend event support.

"onSuspend" event is sent to the main page before it is closed.
This gives the application an opportunity to do some clean up.

When application process manager finds that the last open window is closed,
it sends 'onSuspend' event to main page. The event handler is
executed first in main page, then a finish event is sent out.

The application process manager is an observer of finish
event so that it closes main page when notified.
Merge pull request #1234 from shaochangbin/onSuspend

[Runtime] Implement onSuspend event support.