Reorder checks in parse_value

Run the fastest checks first before doing function calls

Change-Id: I6a012ad2d8d35bbfa6593454c3251c98e12f6f52
Reviewed-on: http://review.couchbase.org/34892
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>