Reduced the number of synchronization points in DD

Some changes have been made to th edomain decomposition part of the code
to reduce the number of wait operations.
The wait_for_prev iteration mechanism has been slightly modified into some
critical routines so that uses a shmem call to increment the call counter rather
than the C increment operator. This is to avoid compiler optimizations to mess
around with the synchronization.