Fix NPE when preparing statements

patch by blere; reviewed by slebresne for CASSANDRA-8090