Add thread-safe methods from rrdtool
Add python3 support for thread safe methods