Fix usage of hardcoded ``errno`` values in the tests.