When finished downloading, explicitly cancel the heartbeat thread
When finished downloading, explicitly cancel the heartbeat thread

We must be careful to not leave the control channel in a bad state,
so we cancel an Lwt.task, and use Lwt.pick [ task; sleep ] to cancel
only between heartbeats.

Signed-off-by: David Scott <63c9eb0ea83039690fefa11afe17873ba8278a56@eu.citrix.com>

xapi-project/xapi-xe