config: Fix inf loop using ast_category_browse and ast_variable_retrieve

Fix infinite loop when calling ast_variable_retrieve inside an
ast_category_browse loop when there is more than 1 category with
the same name.

Tested-by: George Joseph

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

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


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