Revert to old custom tolines function since strtok_r is not portable.