Remove duplicate code from libplatform

Change-Id: I6e1541722be08d30ea7cbcc3cbcd21c3c6f99bca
Reviewed-on: http://review.couchbase.org/32417
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>