backport from trunk (rev #9616)
- fixed a race condition when a CANCEL is received when cancelled INVITE is not yet completely processed:
* When t_forward_nonack() start, transaction is still not cancelled.
* When cancel_invite() process transaction, not all branches are created yet.
Result : cancel_invite() process correctly created branches but not ones created later. This is ending with never cancelled branches.

Credits for the spoting and solving this go to Christophe Sollet 
Closes patch #3545138