Fix unintended update with conditional statement

patch by slebresne; reviewed by iamaleksey for CASSANDRA-6893
Replace equals by type compare