Followup to CASSANDRA-6916 - fix bug in cleanup and add unit test.