Fixes #382 where a NPE causes the TimerTask from running again.
Merge pull request #563 from pveentjer/fix/2.x/382-heartbeattimer-hardening

Fixes #382 where a NPE causes the TimerTask from running again.