Documentation: add thread safety warning in API