Expose a unique index for each event loop buffer

This can be helpful for indexing into other datastructures based on the
messages, by giving an identifier which will be unique as long as the
message is pinned.

Change-Id: I49ce18fba25a796005e64b40e5d1d5c55ca15543
diff --git a/aos/ipc_lib/lockless_queue.h b/aos/ipc_lib/lockless_queue.h
index 5676c53..afa7ced 100644
--- a/aos/ipc_lib/lockless_queue.h
+++ b/aos/ipc_lib/lockless_queue.h
@@ -258,6 +258,8 @@
               aos::realtime_clock::time_point *realtime_sent_time = nullptr,
               uint32_t *queue_index = nullptr);
 
+    int buffer_index() const;
+
    private:
     friend class LocklessQueue;
 
@@ -298,9 +300,9 @@
 
     // Attempts to pin the message at queue_index.
     // Un-pins the previous message.
-    // Returns true if it succeeds.
-    // Returns false if that message is no longer in the queue.
-    bool PinIndex(uint32_t queue_index);
+    // Returns the buffer index (non-negative) if it succeeds.
+    // Returns -1 if that message is no longer in the queue.
+    int PinIndex(uint32_t queue_index);
 
     // Read at most size() bytes of data into the memory pointed to by Data().
     // Note: calls to Data() are expensive enough that you should cache it.