Fix heartbeat pthread_create segmentation fault

In recent Julia builds (Version 0.3.0-prerelease+1379 Commit 00760bd*), at least in Arch Linux, IJulia kernel segfaults in the heartbeat pthread creation.

I found that moving the heartbeat_c cfunction object out of the start_heartbeat function solves the issue.

(Probably this is the issue also mentioned by @aelg in #138)