cutils: refine strtol error handling in parse_debug_env