importer: when pruning, account for summary entries
To support summary statistics, the build table contains rows for builds even after they are pruned. Take this into account when pruning. The prune limit should be counted only for builds that have result rows (have not already been pruned).