config: bug: Fix SEGV in ast_category_insert when matching category isn't found

If you call ast_category_insert with a match category that doesn't exist, the
list traverse runs out of 'next' categories and you get a SEGV.  This patch
adds check for the end-of-list condition and changes the signature to return
an int for success/failure indication instead of a void.

The only consumer of this function is manager and it was also changed to use
the return value.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3993/
........

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

Merged revisions 423277 from http://svn.asterisk.org/svn/asterisk/branches/11
........

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/13@423279 f38db490-d61c-443f-a65b-d21fe96a405b
Only install dahdi_span_config_hook if DAHDI is enabled

This patch changes the install to only install the hook script if
DAHDI is enabled. It also adds the script to the uninstall task, and
moves the DAHDI_UDEV_HOOK_DIR variable so that it's not between the
_MAKEOPTS variables and their comment.

This allows installs which specify a --prefix to work normally, as
long as they don't enable DAHDI.

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


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