media_index: Make media indexing tolerable of bad symlinks.

Media indexing will now skip over files and directories that stat
will not return information about. This can occur under normal
conditions when a symbolic link points to a location that no longer
exists.
........

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@403313 f38db490-d61c-443f-a65b-d21fe96a405b
Add channel locking for channel snapshot creation.

This adds channel locks around calls to create channel snapshots as well
as other functions which operate on a channel and then end up
creating a channel snapshot. Functions that expect the channel to be
locked prior to being called have had their documentation updated to
indicate such.
........

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


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