**Describe the bug**
`strtol` to used in a few places. In some places, its return value is compared to error codes, instead of comparing `errno` to those codes. It also compares to the incorrect error code (`EINVAL` instead of `ERANGE`), leading to non-sensical, over-constrained conditions.

Below is an example:
<img width="1155" alt="image" src="https://github.com/Blosc/c-blosc2/assets/43664/05b449b8-fcb8-4f24-ac3b-d487c9e522c0">


**To Reproduce**
Set environment variable `BLOSC_CLEVEL` or `BLOSC_TYPESIZE` or `BLOSC_NTHREADS` to `22`

**Expected behavior**
No warnings / errors when `22` is used for any of those values.

**Logs**
If applicable, add logs to help explain your problem.

**System information:**
 - OS: macOS
 - Compiler: Clang
 - Version: 16
Incorrect testing of strtol failure modes
This is a GitHub Issue
repo:c-blosc2
owner:Blosc
Title : Incorrect testing of strtol failure modes
Issue date:

--- start body ---
**Describe the bug**
`strtol` to used in a few places. In some places, its return value is compared to error codes, instead of comparing `errno` to those codes. It also compares to the incorrect error code (`EINVAL` instead of `ERANGE`), leading to non-sensical, over-constrained conditions.

Below is an example:
<img width="1155" alt="image" src="https://github.com/Blosc/c-blosc2/assets/43664/05b449b8-fcb8-4f24-ac3b-d487c9e522c0">


**To Reproduce**
Set environment variable `BLOSC_CLEVEL` or `BLOSC_TYPESIZE` or `BLOSC_NTHREADS` to `22`

**Expected behavior**
No warnings / errors when `22` is used for any of those values.

**Logs**
If applicable, add logs to help explain your problem.

**System information:**
 - OS: macOS
 - Compiler: Clang
 - Version: 16
--- end body ---
