Fix app_voicemail Segfault And A Few Memory Leaks

The original report was that app_voicemail would crash.  This was caused by
ast_config_load() returning CONFIG_STATUS_FILEINVALID but no checks being
performed for that return status.  After adding the initial patch to fix this
issue, Jaco Kroon (jkroon) added some fixes to memory leaks he had discovered.

During review, Walter Doekes (wdoekes) suggested adding a helper function in
order to determine if we had a valid configuration or not.

This patch does the following:

* Creates a helper function to check if the configuration is valid

* Adds calls to the new helper function where appropiate

* Fixes memory leaks where the code returned without running
  ast_config_destroy() on the configuration that was loaded

(closes issue ASTERISK-21302)
Reported by: Jaco Kroon
Tested by: Jaco Kroon, Michael L. Young
Patches:
    asterisk-11.3.0-app_voicemail-ast_config-fixes.patch
                                                       Jaco Kroon (license 5671)
    asterisk-21302-valid_cfg_and_mem_leaks_v3-1.8.diff
                                                 Michael L. Young (license 5026)

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

Merged revisions 385551 from http://svn.asterisk.org/svn/asterisk/branches/1.8


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/11@385557 f38db490-d61c-443f-a65b-d21fe96a405b
Allow codec_resample to be unloaded

Ensure that trans_size is correct to prevent uninitialized entries from
preventing reload.

(closes issue ASTERISK-21401)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    codec_resample-unload.patch uploaded by Corey Farrell


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/11@385582 f38db490-d61c-443f-a65b-d21fe96a405b
Fix Manager Segfault When app_queue Is Unloaded

When app_queue is unloaded, some manager commands are not being unregistered
which result in a segfault.  This patch corrects this.

(closes issue ASTERISK-21397)
Reported by: Peter Katzmann, Corey Farrell
Tested by: Corey Farrell
Patches:
    asterisk-21397-missing-unreg-manager-cmd_1.8.diff
                                                 Michael L. Young (license 5026)
    asterisk-21397-missing-unreg-manager-cmd_11.diff
                                                 Michael L. Young (license 5026)

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

Merged revisions 385593 from http://svn.asterisk.org/svn/asterisk/branches/1.8


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