Fix sync_edw.get_all_datasets to use correct loop variable.

The tests here are really brittle and could really do with reworking sometime.
Merge branch 'master' into encode2-public-access-1134