Simplified the closing of the client by removing the boolean flag and signalling to ping by closing the channel.

time.Ticker was a better fit for what's happening in BackgroundNodePing. I've also removed a possible memory leak by closing the ticker when the client is closed.