Allow to build sorted lists

Change-Id: I26a74a6ddeb08a1f2e666c0d8d0937269e581dad
Reviewed-on: http://review.couchbase.org/27729
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Win32 IOCP

Change-Id: If57914db039ff8ffdd0e660f9aac5e9276ab5cbf