Use async method for setting keyspace to avoid deadlock

If we try to set the keyspace for connections in blocking way,
the event loop thread can end up being the blocked thread, resulting
in deadlock and a hung process.