Update bundled sqlite to 2.7.16.1

While here make it use the system hearder when possible.
Readd the shell.c patch so that pkg shell alway open the local database
by default and the sqlite shell is opened with pkgng custom functions
loaded.