Make Cassandra functions exception safe.
Make Cassandra functions exception safe.

In Cassandra functions, it normally calls BORROW_CLIENT to fetch a
MyCassandraClient instance, and calls RELEASE_CLIENT to release it.

If some exception is thrown after BORROW_CLIENT, such as when the
cassandra server is down, it would fail to call RELEASE_CLIENT,
finally, it would make the MyCassandraClient pool empty,
and the thread executing BORROW_CLIENT would be blocked forever.

To make it exception safe, in BORROW_CLIENT, it creates a ScopedClient,
the destructor of ScopedClient would release the MyCassandraClient
instance even when exception is thrown.

izenecloud/izenelib,pombredanne/izenelib,izenecloud/izenelib,izenecloud/izenelib,pombredanne/izenelib,izenecloud/izenelib,pombredanne/izenelib,pombredanne/izenelib