MB-9776: Throw error on queries with group and group_level

Prior to this change `group` and `group_level` where overriding
each other. `group` was parsed as `group_level=exact`. This means
that the value of `group_level` was determined by the ordering
when both `group` and `group_level` were given.

This leads to confusion. With this change the following error will
be thrown in case both `group` and a `group_level` are specified
in the query:
Query parameter `group_level` is "not compatible with `group`

Change-Id: Idfa08e49760b159843ec49f484cdc063dd010c89
Reviewed-on: http://review.couchbase.org/31251
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Volker Mische <volker.mische@gmail.com>
Fix race between incremental updates and header checkpointing

The header checkpoints can not happen concurrently with incremental
updates, otherwise we can get a corrupted index file.

This can make headers be partially overwritten by the external processes
(couchstore does not open its files with O_APPEND) or have a wrong
padding/positioning as the view group/couch_file process is not aware
of the real current eof of the file

Change-Id: I8c0c98084f67075bb082d53d4457a11d9c7fb0b9
Reviewed-on: http://review.couchbase.org/33488
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Sarath Lakshman <sarath@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Merge remote-tracking branch 'remotes/couchbase/master' into upr

Change-Id: I0669f9badfe25411a9a13d8aa9ba6f16069970fb