MB-8531: Make write_kvs return the tmp files

This a commit in preparation for the spatial indexer

Change-Id: I20b4250cf2a5764516b50282d66929f4e22bbf4d
Reviewed-on: http://review.couchbase.org/27219
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>