Added threads to PortfolioController

Now PortfolioController uses threads for PortfolioController::run().
Caller of PortfolioController::run() must make sure to call
PortfolioController::lock() and PortfolioController::unlock()
to lock and unlock the mutex for the threads.