Improve handling of duplicate errnos.