Check if statssocket is availble before sending atoms

The first APEXd instance starts without any APEXes. Hence it can't use
libraries from APEXes. Even though the method
installAndActivatePackage() is invoked by PackageManager after APEXes
are activated, the first apexd instance may be still alive and serve the
method. In such case, because it can't use APEX libraries
it should check the API availability before using it.

Bug: 281162849
Test: atest StagedRollbackTest
Change-Id: I27f562b90d3efc04857ab1b8091e4b95541f8939
1 file changed