Fix {Host,Service,User}Group::{Add,Remove}Member isn't thread-safe.

Fixes #5699