Purge C samples before counting samples when printing flat Profile data

This avoids the error "ERROR: Reducing over an empty array is not allowed." when calling Profile.print(format=:flat) on a profile sample set that has only C samples
Merge pull request #8639 from JuliaLang/sf/profile_flat

Purge C samples before counting samples when printing flat Profile data