Print system may get stuck bound to a print service

1. If a print service dies, is restarted and at the time of the
   restart the service has neither print jobs nor a discovery
   serssion it gets stuck into a bound state. Now it unbinds if
   after binding and ensuring it is in the lifecycle state right
   before the death there are no active print jobs and no discovery
   session.

   Also when a print service dies we fail all of its print jobs
   but did not update the service that all of its print jobs are
   handled, i.e. it has no active print jobs.

2. Fixed a null pointer exception in UserState

bug:10696723

Change-Id: Id0a67846093fca5d4c1e10843eaf6aa90169d942
2 files changed