AppOpsService: Optimize persistent xml file structure

Optimize persistent xml file to follow in-memory structure and this
reduces duplication of uid tag in the xml when multiple packages
belong to the same uid.

Change-Id: I1f2d67f404ce7fdf29ebc4003ab9ebf4964c6eb5