Flush buckets only if COUCHBASE_FLUSH_BUCKETS set

Unique identifiers are more performat way to avoid side effects

Change-Id: I1540dd2ad726cf3718e7b55ec8572af00a3ca809
Reviewed-on: http://review.couchbase.org/23199
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
RCBC-42 Catch exceptions from ruby callbacks

Problem:
Exceptions in the ruby callbacks (non-local jumps) break libcouchbase
internals because it assumes that callback won't do such things.

Solution:
Catch all exceptions in the callbacks and forward then to
Bucket#on_error callback, which in turn may not raise exceptions. If
the library detects that #on_error raises exception it will output a
warning using rb_warning() and nothing more. All exceptions occured
before running callback from ruby-land will be attached to to result
object as usual.

Change-Id: Ibce6458255906cf0e784b1fff6498aad1e54f5c4
Reviewed-on: http://review.couchbase.org/23200
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Sokolov Yura <funny.falcon@gmail.com>
Enforce GC protection on HTTP callbacks

Change-Id: Ie149aac7a1ee6768305ab5786e1d26965cfcce04
Reviewed-on: http://review.couchbase.org/23203
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Remove HTTP callback from protected space after usage

Change-Id: Ib170bf29e3e0003dbd61b624dd2930ca99f529d4
Reviewed-on: http://review.couchbase.org/23209
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Protect callbacks from any subclasses of Exception

Assertion class inherits from Exception instead of StandardError

Change-Id: Iae1ade9223056bc62d3af47a4f4354a7a45e1970
Reviewed-on: http://review.couchbase.org/23211
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
specialized io plugin for releasing Ruby GVL

Ruby 1.9.x uses global lock for ensuring integrity, and blocking calls
should be called inside rb_thread_blocking_region to allow other threads
to be runned.

Ruby 1.8.7 have only green threads, so that rb_thread_schedule should
be called manually.

this io plugin respects ruby's nature.

Change-Id: I024680271691d7d29cce707a7ce140ca0a3e5873
Reviewed-on: http://review.couchbase.org/23206
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reset exception member before running request

Change-Id: Ia7255788ab5d4c3d0021d0930d1c24d99b0261d0
Reviewed-on: http://review.couchbase.org/23213
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
multithread_plugin.c: add missing definitions for systems without poll.h

Change-Id: I43cbf61ac8fb6abd5051bece190eb2a330e59f3c
Reviewed-on: http://review.couchbase.org/23214
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Better changelog

Change-Id: I1d1ee107e68b0666443db6c1fb9914d8b12351f1
Reviewed-on: http://review.couchbase.org/23208
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Bump version 1.2.0

Change-Id: If0c7b9207652276ef59659a03059ce6b9088909f
Reviewed-on: http://review.couchbase.org/23225
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>