AST-2013-004: Fix crash when handling ACK on dialog that has no channel

A remote exploitable crash vulnerability exists in the SIP channel driver if an
ACK with SDP is received after the channel has been terminated. The handling
code incorrectly assumed that the channel would always be present.

This patch adds a check such that the SDP will only be parsed and applied if
Asterisk has a channel present that is associated with the dialog.

Note that the patch being applied was modified only slightly from the patch
provided by Walter Doekes of OSSO B.V.

(closes issue ASTERISK-21064)
Reported by: Colin Cuthbertson
Tested by: wdoekes, Colin Cutherbertson
patches:
  issueA21064_fix.patch uploaded by wdoekes (License 5674)
........

Merged revisions 397710 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 397711 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/11@397712 f38db490-d61c-443f-a65b-d21fe96a405b