Purge unreferenced closed checkpoints until max checkpoints allowed
Purge unreferenced closed checkpoints until max checkpoints allowed

If 'keep_closed_checkpoints' engine param is set to true, we then
should garbage-collect unreferenced closed checkpoints until the
number of checkpoints becomes equal to the max checkpoints allowed.

Change-Id: I70aeecf30f78b648c955c97efb5625e6898cc4c8
Reviewed-on: http://review.couchbase.org/11944
Reviewed-by: Michael Wiederhold <a17fed27eaa842282862ff7c1b9c8395a26ac320@couchbase.com>
Tested-by: Chiyoung Seo <8b279095f11c26cc21045fda5a3e51debb005aa9@gmail.com>

couchbase/ep-engine,sriganes/ep-engine,couchbase/ep-engine,zbase/ep-engine,daverigby/ep-engine,zbase/ep-engine,daverigby/ep-engine,owendCB/ep-engine,abhinavdangeti/ep-engine,hisundar/ep-engine,couchbase/ep-engine,membase/ep-engine,abhinavdangeti/ep-engine,hisundar/ep-engine,couchbaselabs/ep-engine,membase/ep-engine,teligent-ru/ep-engine,hisundar/ep-engine,couchbaselabs/ep-engine,hisundar/ep-engine,zbase/ep-engine,couchbase/ep-engine,jimwwalker/ep-engine,couchbaselabs/ep-engine,jimwwalker/ep-engine,couchbaselabs/ep-engine,sriganes/ep-engine,daverigby/kv_engine,jimwwalker/ep-engine,teligent-ru/ep-engine,membase/ep-engine,abhinavdangeti/ep-engine,jimwwalker/ep-engine,daverigby/kv_engine,membase/ep-engine,daverigby/ep-engine,daverigby/kv_engine,zbase/ep-engine,zbase/ep-engine,sriganes/ep-engine,owendCB/ep-engine,abhinavdangeti/ep-engine,abhinavdangeti/ep-engine,owendCB/ep-engine,daverigby/kv_engine,teligent-ru/ep-engine,couchbaselabs/ep-engine,owendCB/ep-engine,daverigby/ep-engine,teligent-ru/ep-engine,sriganes/ep-engine