add string_transfer function

Change-Id: Ie3cf6352a97b3e113c2fb1ffa8af30cce8e62d86
Reviewed-on: http://review.couchbase.org/31700
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Mark Nunberg <mnunberg@haskalah.org>