chan_dahdi: handle DAHDI_EVENT_REMOVED on a pri D-Channel

When a DAHDI device is removed at run-time it sends the event
DAHDI_EVENT_REMOVED on each channel. This is intended to signal the
userspace program to close the respective file handle, as the driver of
the device will need all of them closed to properly clean-up.

This event has long since been handled in chan_dahdi (chan_zap at the
time). However the event that is sent on a D-Channel of a "PRI" (ISDN)
span simply gets ignored.

This commit adds handling for closing the file descriptor (and shutting
down the span, while we're at it).

It also adds a CLI command 'pri destroy span <N>' to destroy the span
and its DAHDI channels.

Backported from trunk/12.

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

Merged revisions 394552 394567 from http://svn.asterisk.org/svn/asterisk/trunk


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