KUDU-27. Fix bug in cbtree for cbtree-test
KUDU-27. Fix bug in cbtree for cbtree-test

The issue here was that we were calling memcpy() using the value pointer
stored in the leaf node, before doing the optimistic concurrency control
version check. This left a race condition where the pointer would be
invalid, and the memcpy would SEGV.

The fix is to simply wait until after the OCC check before doing the memcpy.

Tested by looping the cbtree-test TestConcurrentInsert a few thousand times.
This used to fail within 2000 iterations, now passes.

Change-Id: I92c10ea2050bf43d12dd739f110749929c8c6c3e
Reviewed-on: http://gerrit.ent.cloudera.com:8080/811
Reviewed-by: Matteo Bertozzi <1d5ca967930bde0bdce795acbf71a5e281d2d4e5@cloudera.com>
Tested-by: jenkins

InspurUSA/kudu,andrwng/kudu,EvilMcJerkface/kudu,InspurUSA/kudu,cloudera/kudu,helifu/kudu,helifu/kudu,andrwng/kudu,cloudera/kudu,cloudera/kudu,EvilMcJerkface/kudu,InspurUSA/kudu,cloudera/kudu,helifu/kudu,helifu/kudu,andrwng/kudu,helifu/kudu,helifu/kudu,cloudera/kudu,EvilMcJerkface/kudu,EvilMcJerkface/kudu,andrwng/kudu,cloudera/kudu,InspurUSA/kudu,andrwng/kudu,helifu/kudu,andrwng/kudu,andrwng/kudu,cloudera/kudu,cloudera/kudu,EvilMcJerkface/kudu,InspurUSA/kudu,cloudera/kudu,EvilMcJerkface/kudu,helifu/kudu,andrwng/kudu,InspurUSA/kudu,EvilMcJerkface/kudu,andrwng/kudu,helifu/kudu,EvilMcJerkface/kudu,InspurUSA/kudu,InspurUSA/kudu,InspurUSA/kudu,EvilMcJerkface/kudu