thread-safe python object pool