(catopen): Correctly determine length of string in NLSPATH evironment