tests: Use errno value rather than a specific int