ARI: Resolve a subscription leak against implicit bridge subscriptions

When a channel in a stasis application is joined to a bridge, a subscription
for that bridge is created implicitly for the stasis application serving the
channel. Prior to this patch, subsequent removals of the channel from the
bridge would leave the subscription open.

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/12@411086 f38db490-d61c-443f-a65b-d21fe96a405b
chan_sip: Fix incorrect use of timers

If update_provisional_keepalive() is called while
send_provisional_keepalive_full() is waiting on the PVT lock, then
pvt->provisional_keepalive_sched_id will be changed to a new sched_id
value by update_provisional_keepalive(), but that new sched_id then may
be overwritten with -1 by send_provisional_keepalive_full(), killing
the pvt's reference to a schedule and "leaking" the reference.

(closes issue ASTERISK-22079)
Review: https://reviewboard.asterisk.org/r/3368/
Reported by: Jamuel Starkey, Matteo, Leif Madsen, Steve Davies
Patches:
    provisional_keepalive_fix.diff uploaded by Steve Davies (license 5012)
........

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

Merged revisions 411089 from http://svn.asterisk.org/svn/asterisk/branches/11


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