Refactor driver::escapeString, more safety.