channels: Return allocated channels locked.

This change makes ast_channel_alloc return allocated channels
locked. By doing so no other thread can acquire, lock, and manipulate
the channel before it is completely set up.

(closes issue AST-1256)

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


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