Fix sync_edw.get_all_datasets to use correct loop variable.

The tests here are really brittle and could really do with reworking sometime.