Fixed an error where a slave cannot become alive to a master in a cluster.

The error was caused by a race in alive msg and fail msg handling procedure.
Merge pull request #3647 from S124568/2.2-fix-instance-not-alive-after-receiving-heartbeat

Fixed an error where a slave cannot become alive to a master in a cluster