Clear the process record nodes' fields during reset

When resetting the linked list for the process records,
individual node's prev/next fields should be cleared too.

Also, link/unlink process record nodes correctly

The new oom adjuster implementation maintains a set of linked lists
where the nodes are basically the process records. These records
are added/remove from this list along with the process lifecycle.
However, there are cases where the process hasn't been fully started
but the oom adjuster has started computations on these new records.
In these case, we should put them into the list as long as we're
creating these process records, or otherwise we'll be hitting
NPE issue.

Bug: 312498619
Test: atest CtsAppTestCases
Test: atest FrameworksMockingServicesTests:MockingOomAdjusterTests
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Test: atest FrameworksMockingServicesTests:AsyncProcessStartTest
Change-Id: I9232514b81bca433b66f0895e5a652198dd60d16
9 files changed