Fix a bug introduced in Synapse v1.7.2 which caused inaccurate membership counts in the room directory.