SynchronizedDelegator for wrapping thread-unsafe objects (#8556)

This implements #8556 from MRI's redmine, which calls for an additional delegator that wraps all calls in synchronization, to make them a bit more concurrency-friendly.