Fix bug in directory depth counting.

The path "dir//file" has the same depth as "dir/file".  Also verify
with local unit tests.

(cherry picked from commit b92de07b63bbcb05ff15a32dda8644ee763acc5d)

Test: /data/nativetest64/installd_utils_test/installd_utils_test
Test: cts-tradefed run commandAndExit cts-dev --abi armeabi-v7a -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 67471251
Merged-In: Iab35b4fe5591ddd42a7121b630cffcd94ad23c40
Change-Id: Iab35b4fe5591ddd42a7121b630cffcd94ad23c40
2 files changed