Reset errno to 0 before calling strtoul() since it sets errno only on error cases. So the following test fails even on correct conversions if errno had a value != 0. Fixes #2506.