Flag mechanism modified to use events

The flag mechanism that synchronises operations across pairs of ranks
now uses events instead of symmetric memory.
Some additional cleanup have been done, moving all shmem related stuff to
shmem_utils, and easing the interface to the flag mechanism so no longer requires
declaring variables where it is used. Now it relies on a symmetric array defined in
the gmx_domdec_shmem_buf_t data structure (wait_events), where each i-th position is
a flag for the i-th PE.