Fix pkg.installed state summary reporting

In 03e4e8a the pkg.installed state was altered to not show all the
package names that were modified if a lot of them were changed, and
instead just mention the number of packages that changed. However, the
number that is being reported is the length of the string result of
commaspace-joining the list of modified package names. This results in
incorrect output. This commit fixes that reporting issue.
Merge pull request #8931 from terminalmage/pkg-state-reporting

Fix pkg.installed state summary reporting