Better sysctl test detection.

Closes #12408