Fix incorrect errno usage on Linux.