Add option to worker to control heartbeat interval.

Thanks to my colleague Craig Northway for the patch.
Merge pull request #1966 from mduggan/worker-heartbeat-option

Add option to worker to control heartbeat interval.