Synchronize getDatasets for workers

This is useful since it allows you to make transactional operations inside workers from multiple threads.