Fix another state-keeping thinko
We need to update pending before we add a listener, as the future
may have already completed and thus we could observe pending being
either null or point to the bad value.
Also update the corresponding checkState() to use identity comparison
and include a proper message.
JIRA: NETCONF-827
Change-Id: If79d7ce71480bab6b35eec6fab63671f949c6cf9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d1a112edda4fa487522010a6330f67defe6359a4)