lib/cpp: fix behavior of `Text::to_cpp_string`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>