IMPALA-3093: ReopenClient() could NULL out 'client_key' causing a crash
IMPALA-3093: ReopenClient() could NULL out 'client_key' causing a crash

When ReopenClient() calls CreateClient() and CreateClient() fails, it
sets 'client_key' to NULL. ReopenClient(), then on seeing that
CreateClient() has failed has to restore the old client key back to
the 'client_key' so that it doesn't remain NULL.

However, there was a bug in the logic which made 'old_client_key' and
'client_key' point to the same thing thereby effectively leaving
'client_key' permanently NULLed out (because even old_client_key got
NULLed out). This on use (mostly in DoRpc()), caused a crash.

This patch fixes the logic so that the correct old client key is
restored on a failure to CreateClient().

Change-Id: I16699534d5e48acfc2720f23e420d63af7bd2931
Reviewed-on: http://gerrit.cloudera.org:8080/2338
Reviewed-by: Tim Armstrong <2f8e34250f03a653da3dc27f7ec203eafdde80fc@cloudera.com>
Reviewed-by: Henry Robinson <3eca10f30041813f045165784e24b5a950a6cc7e@cloudera.com>
Reviewed-by: Silvius Rus <f7ea5851fd59d0434c2e152e6169f61c38e0d175@cloudera.com>
Tested-by: Internal Jenkins

cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,cloudera/Impala,michaelhkw/incubator-impala,cloudera/Impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala,michaelhkw/incubator-impala