Add a thread-safe way of working with Materials with the ProtectedPtr<T> class