modules_k/textops : fix pointer return in substr transformation
Replace a local buffer with a static one, as a pointer to it was returned outside of the function
Credits go to Timo Teräs for spotting the bug
(cherry picked from commit 87f995b66b1f58f9f85b604ba1214412819c9417)