Remove redundant os check

Fixes #5045