Make withsqlite work with multithreaded programs.
The plinth application used by the Freedombox project triggered an
exception in withsqlite when looking up users from the sqlite file,
see <URL: http://lists.alioth.debian.org/pipermail/freedombox-discuss/2013-September/005691.html >
for some details.  This patch make sure the sqlite file is opened in
multithread mode to solve the issue.
Make it a runtime option if sqlite3.connect() should use check_same_thread or not.
fix jsonize to handle values with quotes

previous version would fail with f.e. val = 'foo"bar'
Fix merge conflict.
Merge p1otr/withsqlite: save values with quotes.
Merge petterreinholdtsen:plinth-multithread:

Make withsqlite work with multithreaded programs.

The plinth application used by the Freedombox project triggered an
exception in withsqlite when looking up users from the sqlite file,
for details, see:

http://lists.alioth.debian.org/pipermail/freedombox-discuss/2013-September/005699.html

This patch make sure the sqlite file is opened in multithread mode to
solve the issue.
Leftover, make sure to save the check_same_thread value in the object for use in connect().
Merge pull request #1 from petterreinholdtsen/handle-multithread

Handle multithread