TS-1475: Prevent strtok_r from passing NULL value when it fails