Read DB_MASTER only as needed for summary fields

This patch changes how DB_MASTER is switched in as the read DB for
the Courses table when updating of summary fields. See change
fa32ae936f39d2877de76b6b3df90888623092cb. (Note that this patch is a
bit un-DRY, but for now this seems preferable to the refactoring that
greater DRY-ness would require.)

Change-Id: Iffc31be6b4ebf46a5d6949d1c93ff613ae43a12a
Merge "Read DB_MASTER only as needed for summary fields"