fix to close if an error raised even in keepalive
fix to close standby node on recovering in keepalive