CBQE-0: minor fixes in merge_keys function

Change-Id: I8b4bdc5475502d0e4e0bb4c580c0952dbf19ed55
Reviewed-on: http://review.couchbase.org/33882
Reviewed-by: Sangharsh Agarwal <sangharsh.agarwal@globallogic.com>
Tested-by: Sangharsh Agarwal <sangharsh.agarwal@globallogic.com>