pbx: Fix lack of cleanup on macrolock and context_table

(closes issue ASTERISK-21723)
Reported by: Corey Farrell
Patches:
    core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909)


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