Warn about inconsistent flags

As discussed regarding c5298f15f73136dc3291de1e56541aacce6eb779,
redundant refinement flag synchronization might be expensive, but
allowing inconsistent parallel refinement flags to break a large code
that could have been fixed by redundant synchronization might be
offensive.  This patch aborts upon finding inconsistency when in
debug/devel modes, but simply fixes the problem, warns about it, and
continues when in opt mode; this way we can fix any such bugs and
users should be safe to remove the redundant synchronization later.