pmdaproc - avoid excessive stat calls in cgroups_scan
pmdaproc - avoid excessive stat calls in cgroups_scan

PCP GH #185

cgroup_scan was unnecessarily calling stat to figure out whether
each /sys/fs/cgroup/... entry is a directory or not and therefore
whether to recurse. Instead, use the dirent->d_type field and thus
avoid those stat calls. If d_type is DT_UNKNOWN, then fallback to
the stat method because the platform or cgroup pseudo filesystem
has no support. AFAICT only an ancient glibc would need to fallback.

Perf testing with the simple repro script posted to #185 shows
an almost 50% reduction in system CPU time by eliminating most
of the stat calls. Even better improvements should be evident on
busy systems with deeply nested cgroups.

QA passed for cgroups, pmda.linux and pmda.proc groups. A new QA
test is probably warranted (forthcoming).

adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp,adfernandes/pcp