Fixes #1767: Added API to allow apps to perform clean up when bundle is stopped

Change-Id: I5563e5851ebae0339afabf843b295dd751ddbd1f