PJSIP: Prevent crash if channel has gone away

It is currently possible for an ast_sip_session to exist without an
associated channel as is the case when a new invite is coming in or
just after a hangup is issued on a chan_pjsip channel. Part of the
attended transfer code assumed the channel would be non-NULL and used
it as such causing a crash. This bug was exposed thanks to the attended
transfer ARI test in the test suite.

(closes issue ASTERISK-23287)
Reported by: Matt Jordan


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/12@408941 f38db490-d61c-443f-a65b-d21fe96a405b
PJSIP: Fix some bad spacing


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