Add lock to protect CNode ping state.

Required to stop race between ThreadMessageHandler and ThreadTrickle for ping/pong processing.