Print all logger messages on shutdown

When Asterisk shuts down and shuts down the loggin gsubsystem, any
messages currently in flight will not get logged. This patch prevents the
loop writing messages from breaking out prematurely, such that all of the
messages are logged.

(closes issue ASTERISK-21716)
Reported by: Corey Farrell
patches:
  logger-process-all-messages.patch uploaded by Corey Farrell (license 5909)


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