astdb: crash in sqlite3 during shutdown

When Asterisk is shut down, the astdb_atexit() function releases
(finalize) the previously initiated (prepared) SQL statements in
sqlite3.  Another thread making a subsequent request can cause a
crash in sqlite3.  This patch eliminates that issue by resetting
the statement pointer after it is released/cleared.  The sqlite3
code detects the null pointer, and aborts the operation cleanly.

(closes issue AST-1265)
Reported by: Alexander Hömig
(closes issue ASTERISK-22350)
Reported by: Birger "WIMPy" Harzenetter
Review: https://reviewboard.asterisk.org/r/3078/



git-svn-id: http://svn.asterisk.org/svn/asterisk/branches/11@404344 f38db490-d61c-443f-a65b-d21fe96a405b
res_fax.c: crash on framehook with no dsp in fax detect

In fax_detect_framehook() a null pointer reference can occur where a
voice frame is processed but no dsp is attached to the fax detection
structure.  The code block that rejects frames that detection cannot
be processed on is checking for dsp but falls through when it should
instead return, as this change implements.

(closes issue ASTERISK-22942)
Reported by: adomjan
Review: https://reviewboard.asterisk.org/r/3076/



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