Add locking in cache.py
Add locking in cache.py

fixes: #822 #815

piotr1212/carbon,deniszh/carbon,obfuscurity/carbon,criteo-forks/carbon,graphite-project/carbon,graphite-project/carbon,criteo-forks/carbon,obfuscurity/carbon,piotr1212/carbon,deniszh/carbon