Make controller cache thread safe

reads and writes take place under cache lock
https://trac.torproject.org/8607
Add function for single param cache query

Separate functions for single param cache query and multiple params.
 * get_conf : takes single param, returns value
 * get_conf_map: takes list of params, return dict