Fix missing source location on unbound variable exceptions.
Avoid adding source location on #.expr when expr returns a source object.
Add support for generating heartbeat interrupts using a poll based counter (useful for environments which don't support asynchronous interrupts, such as the emscripten compiler)
Prevent polling at the moment of a thread context switch to guarantee forward progress when heartbeat interrupt rate is very high.