Use var pingInterval as parameter of setInterval

Signed-off-by: Larry Tin <dev@goodow.com>
Merge pull request #767 from larrytin/patch-2

Use var pingInterval as parameter of setInterval