db_cassandra: bug fixes for raw queries using sqlops

(cherry picked from commit 2f9e8d2e122edc5b7950ee6ab0991851c9cd7bbd)
db_cassandra: clone key in a zero-termniated local buffer

- rework from a patch by Jay Binks

(cherry picked from commit 3cde37cf10795b4eb785ffd141a8b28e64864f5d)