fixed path to upgrade the indexes for system.users #673 #674

This makes sure we correctly serialize the index metadata on upgrade of
the index for system.users, and adds code to fix collections corrupted by
startup, to fix #674.
misc cleanup while investigating #673 and #674
added a test for #673 and #674

fixes #673
fixes #674