log deprecated function calls FS#2399

This introduces a new dbg_deprecated() function which allows for easy
marking of deprecated functions. Each call is logged to the debuglog
when debuggin is enabled.