[sr-dev] git:4.0: tm: fix possible segfault in cancel_branch()