Fix race condition where duplicated requests may be handled by multiple threads.

This is the Asterisk 13 version of the patch. The main difference is in the pubsub
code since it was completely refactored between Asterisk 12 and 13.

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



git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/13@427841 f38db490-d61c-443f-a65b-d21fe96a405b
app_confbridge: Play "leader has left" sound even when musiconhold is enabled.

Currently if the leader of a conference bridge leaves any participant
that has musiconhold enabled will not hear the "leader has left" sound.
This is because musiconhold is started and THEN the sound is played.

This change makes it so that the sound is played and THEN musiconhold
is started. This provides a better experience for users as they may not
have known previously why they went back to musiconhold.

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

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

Merged revisions 427845 from http://svn.asterisk.org/svn/asterisk/branches/12


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