Cherry-pick the change at [2d4505510032bf9] into the 3.6.1 branch.
Backport a fix from [6b0cabd017ed25] (version 3.6.16 - [2009-03-05]) to the
3.6.1 branch, a fix that prevents a null pointer deref if one of the
column access routines such as sqlite3_column_int() is called with a
NULL first parameter.
Backport the localtime() failure patch from trunk.