PCBC-518: Detect and cleanup connections left in bad state
PCBC-518: Detect and cleanup connections left in bad state

When `max_execution_time` setting set, the connection might be left in bad
state, when the event loop is not properly closed. This patch allows to
detect such connections in persistent cache and close them properly.

Change-Id: I072afe724f33fbeebff0ae73496147d15e3e1a92
Reviewed-on: http://review.couchbase.org/87388
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>

couchbaselabs/php-couchbase,couchbaselabs/php-couchbase,couchbaselabs/php-couchbase,couchbaselabs/php-couchbase,couchbase/php-couchbase,couchbase/php-couchbase,couchbase/php-couchbase,couchbase/php-couchbase