Use netstat on sunos.

Fixes #14184
Use netstat on sunos: fixups

Make it DRYer, should no longer fail lint.
Merge pull request #15422 from nshalman/issue-14184

Use netstat on sunos.