Add the PrepareForSleep/Shutdown signals

This patch adds the PrepareForSleep/Shutdown signals so apps can
listed for these signals and perform operations prior to the event
such as logging out of online chatrooms.