Add a condition and remove resources when skipping post install

This change adds a condition to skip post install when a system package
is removed before update. And remove the update failed package's
resources safely, as they are not valid any more.

Bug: 162757027
Test: compile & verify basic functions working
Change-Id: I5ad778048227b1b0d3890dfc1f1f9bd314aff458
1 file changed