Better sysctl test detection.

Closes #12408
Pylint
Merge pull request #12853 from cachedout/12408

Better sysctl test detection.