Implemented retries handling. It allows specifying how many times pong should try
pinging before error callback is invoked.