Avoid potencially-stale errno usage.