settings: properly count preferences in group

When the first preference in a settings preference fragment is a caterory, this method cannot
find the first preference of the group, returning an incorrect position.
xe: Lockscreen Settings -> Screen settings

Reason for that is that there's no way to differentiate 0 from -0. Fix
that by avoiding overloading integer semantics and clearly splitting the
result count from the 'was stopAt found' flag.

Change-Id: I68cfde27b9860246b1cc3671dfb35320c4ff3ea8
Merge branch 'ose' of github.com:Team-OSE/packages_apps_Settings into ose