Fix get_courses to handle inflight changes

more rigorously.

@cpennington if you don't have time to review, please punt to someone capable
@mattdrayer @ziafazal this should fix your problem. please review and confirm. (I did red-yellow-green TDD)

Should this wait until the bulk operation finishes?