pw_rpc: Hold the mutex when registering services

- Guard the pw::rpc::Server's service list with the RPC mutex.
- Support registering multiple services in the RegisterService() call so
  that the lock only has to be required/released once.

Change-Id: I3713c61bc87bc7679eb577100c130c16bbf629aa
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/84741
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Erik Gilling <konkers@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/pw_rpc/docs.rst b/pw_rpc/docs.rst
index 0f4efb6..cbce407 100644
--- a/pw_rpc/docs.rst
+++ b/pw_rpc/docs.rst
@@ -303,13 +303,12 @@
   // Declare the pw_rpc server with the HDLC channel.
   pw::rpc::Server server(channels);
 
-  pw::rpc::TheService the_service;
+  foo::bar::TheService the_service;
+  pw::rpc::SomeOtherService some_other_service;
 
   void RegisterServices() {
-    // Register the foo.bar.TheService example service.
-    server.Register(the_service);
-
-    // Register other services
+    // Register the foo.bar.TheService example service and another service.
+    server.RegisterService(the_service, some_other_service);
   }
 
   int main() {