Move a NULL check to a place that makes more sense.

Two variables were being checked for NULLity immediately
after being declared NULL. I moved the NULL check until
after the variables are allocated.

This allows for the "channelvars" option in manager.conf
to work as intended again.
........

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


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