Improve initial INVITE handling and fix crash due to rapidly arriving CANCEL.

(closes issue ASTERISK-22150)

Review: https://reviewboard.asterisk.org/r/2696/


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@395351 f38db490-d61c-443f-a65b-d21fe96a405b