Correct errno value of OSError exception.