Reduces the number of database queries made when populating roles during install/multisite site creation by 344 (347 queries down to 3).
`populate_roles()` has been modified to prevent an individual database query each time a role or capability is added to the `WP_Roles` object. Instead the roles option, `{$wpdb->prefix}user_roles` is updated once at the end of the function call.
Introduces a test to ensure that updating the roles option via `WP_Roles` and updating the option in the manner now used by `populate_roles()` results in the same capabilities been applied to a role.
Props fliespl, johnjamesjacoby, ocean90, realloc, rishabhwp, sainathpoojary, sirlouen, spacedmonkey, swissspidy.
Fixes#37687.
Built from https://develop.svn.wordpress.org/trunk@60614
git-svn-id: http://core.svn.wordpress.org/trunk@59950 1a063a9b-81f0-0310-95a4-ce76da25c4cd