Reduce threading in market.py

* These operations end up accessing the DB but pySQLite doesn't
  support multithreaded access.
Merge pull request #708 from Renelvon/less_threading

Reduce threading in market.py