r938: on an error save the original errno before calling iconv to reset