Bug Fixes (single zmq context, timeout in database connection)

Simultaneous access to a row when writing and reading will cause an exception. This allows the proces to wait until it's available and then write instead.
OK, here goes what I think: It appears `sqlite3` disallows [multithreaded access](https://docs.python.org/2/library/sqlite3.html#multithreading), so we shouldn't be having many threads accessing the DB either. Thus, the "correct" timeout is extremely machine dependent; 10 seconds may be enough for your CPU, but not for others. Maybe we should try to curb the amount of concurrent threads we keep, and the timeout problem will vanish just like that. @yagoulas has suggested using a thread pool.

I am merging that, since it obviously works for you. Still, it feels weird; one shouldn't have to wait 10 seconds for a lookup in the local database, at least from a UX standpoint.