Check for a valid WP_Role object before adding capabilities

During installation, roles aren't available yet and things break if we rely on them in mu-plugins