ART: Optimize PreSetup pass for oat-file open

The PreSetup pass for opening an oatfile with dlopen parses all
shared objects and tries to retrieve the corresponding mem map
(so as to have a fake MemMap to reserve the space for any scanning
operations and so on). Optimistically optimize this pass by counting
the number of shared objects before the dlopen, and skipping as
many afterwards.

This saves about half a millisecond on an N6P.

Bug: 28801010

(cherry picked from commit 9821cceebf077cb747aed543582b3d740a03ea7f)

Change-Id: I70156f9875e89c5af3c9e36e8f01c5662e3f736e
1 file changed