If using the Lock TTL feature with Consul, the code
path in libkv is issuing a Put in the background through
the PeriodicRenewal call. The error is then eaten up and
ignored on the candidate loop. This would lead to the
candidate and followers being stuck in their candidate
loop. Consequence would be that they would not retry to
take the lock ending in a state with no Leader.
This patch restores an explicit error check instead of
wrongfully passing on the error to the channel before
giving it back to the caller.
Signed-off-by: Alexandre Beslic <abronan@docker.com>