Templatize shared_buf_ref_t on its type.