Exposes the implementation of CompletionQueue#pluck

- allows it to be used from other files, e.g, in Call#run_batch
- this keeps code related to releasing the GIL during #pluck in one place
diff --git a/src/ruby/ext/grpc/rb_completion_queue.c b/src/ruby/ext/grpc/rb_completion_queue.c
index 3fdbdd8..215de99 100644
--- a/src/ruby/ext/grpc/rb_completion_queue.c
+++ b/src/ruby/ext/grpc/rb_completion_queue.c
@@ -140,8 +140,19 @@
 
 /* Blocks until the next event for given tag is available, and returns the
  * event. */
-static VALUE grpc_rb_completion_queue_pluck(VALUE self, VALUE tag,
-                                            VALUE timeout) {
+VALUE grpc_rb_completion_queue_pluck(VALUE self, VALUE tag,
+                                     VALUE timeout) {
+  grpc_event *ev = grpc_rb_completion_queue_pluck_event(self, tag, timeout);
+  if (ev == NULL) {
+    return Qnil;
+  }
+  return grpc_rb_new_event(ev);
+}
+
+/* Blocks until the next event for given tag is available, and returns the
+ * event. */
+grpc_event* grpc_rb_completion_queue_pluck_event(VALUE self, VALUE tag,
+                                                 VALUE timeout) {
   next_call_stack next_call;
   MEMZERO(&next_call, next_call_stack, 1);
   Data_Get_Struct(self, grpc_completion_queue, next_call.cq);
@@ -151,9 +162,9 @@
   rb_thread_call_without_gvl(grpc_rb_completion_queue_pluck_no_gil,
                              (void *)&next_call, NULL, NULL);
   if (next_call.event == NULL) {
-    return Qnil;
+    return NULL;
   }
-  return grpc_rb_new_event(next_call.event);
+  return next_call.event;
 }
 
 /* rb_cCompletionQueue is the ruby class that proxies grpc_completion_queue. */
diff --git a/src/ruby/ext/grpc/rb_completion_queue.h b/src/ruby/ext/grpc/rb_completion_queue.h
index 38025ea..13715cc 100644
--- a/src/ruby/ext/grpc/rb_completion_queue.h
+++ b/src/ruby/ext/grpc/rb_completion_queue.h
@@ -40,6 +40,14 @@
 /* Gets the wrapped completion queue from the ruby wrapper */
 grpc_completion_queue *grpc_rb_get_wrapped_completion_queue(VALUE v);
 
+/**
+ * Makes the implementation of CompletionQueue#pluck available in other files
+ *
+ * This avoids having code that holds the GIL repeated at multiple sites.
+ */
+grpc_event* grpc_rb_completion_queue_pluck_event(VALUE cqueue, VALUE tag,
+                                                 VALUE timeout);
+
 /* rb_cCompletionQueue is the CompletionQueue class whose instances proxy
    grpc_completion_queue. */
 extern VALUE rb_cCompletionQueue;