Fix bug introduced by MB-11259 [Buffer acknowledgment should have extlen of 4]

Update testapp so `make test` passes. Bug introduced by
b4a135a2e6c25c01dec9b09e51ca2ac6e838bcb8

Change-Id: I58e164a3670562d4ec0822ab6d566ae4f90d4e27
Reviewed-on: http://review.couchbase.org/38966
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Merge remote-tracking branch 'membase/3.0'

* membase/3.0:
  Fix bug introduced by MB-11259 [Buffer acknowledgment should have extlen of 4]

Change-Id: I45f536efbdf32198223eac9cab42f8ee369f67a2
MB-11559: Move stats-related functionaltiy to stats.{c,h}

... in preparation for files other than memcached.c calling stats functions.

Change-Id: I27e7a24eaf778af5cb11fbd71d1f0dd42b209fa7
Reviewed-on: http://review.couchbase.org/38967
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
MB-11559: Move event handling code to own file

Move connection-related code into new file `connections.`, to allow
memcached.c and thread.c to share event loop code and connection code.

Change-Id: I80bcda990a20b8efe28e1b45e7e386105b838f95
Reviewed-on: http://review.couchbase.org/38969
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
MB-11559: Ensure conn buffers are acquired for all event loops

Second event loop in thread.c wasn't acquiring a loan on read/write
buffers, causing a segfault if that event loop tried to process a
command.

Fix by refactoring the two event loops into a common function.

Also fix a related crash when freeing UPR connections - ensure that
the TAP & UPR flags are cleared before returning buffers in
conn_cleanup(), otherwise the cleanup at the end of the event loop may
dereference a NULL thread ptr.

Change-Id: I372b06f76db577e4dc3628534f5dcf1ce3472add
Reviewed-on: http://review.couchbase.org/38968
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Merge remote-tracking branch 'membase/3.0.1'

* membase/3.0.1:
  MB-11559: Ensure conn buffers are acquired for all event loops
  MB-11559: Move event handling code to own file
  MB-11559: Move stats-related functionaltiy to stats.{c,h}
  Fix bug introduced by MB-11259 [Buffer acknowledgment should have extlen of 4]

Change-Id: Ie69e46da4a535079300148bade417418e7fb3318