Continue dexopt for other packages when a package reports an error

- The job itelf will report an error if any error happens.
- The failed APK will be added to failed list so that it is not
  tried agai until the package is updated.
- Updated the unit test to test this logic.

Bug: 230869482
Test: atest com.android.server.pm.BackgroundDexOptServiceUnitTest
      atest android.compilation.cts.BackgroundDexOptimizationTest
Change-Id: I3a55b07b0f88d94fdf8a70f3e365be743dc1782e
2 files changed