The docs for mongoc_client_pool_set_apm_callbacks say:
This function can only be called once on a pool, and must be called before the first mongoc_client_pool_pop.
There's no check for whether or not a client has been popped already in this function, so I think we should add that.
This might also be kind of a silly point, but I think this function should lock the client pool mutex, or (maybe) be described as "not thread safe" in the docs. In reality I'm sure nobody calls this function from multiple threads, but if someone did, the behavior would be weird.
mongoc_client_pool_set_error_api should probably lock the pool's mutex or be described as "not thread safe" in the docs as well. I'm guessing nobody actually calls this from multiple threads either, so I don't think it's a "real" bug, but it does look a bit strange.