Don't run ping ticker in own goroutine and get rid of long-running "defer"s.
Merge pull request #5 from fancycode/writepump_ping_goroutine

Writepump optimizations