P-to-P synchronisation without global_barrier

P-to-P synchronisation using locks and events replaces the previous flag mechanism
to synchronise the comm. between pairs of processors in sendrecv variants.
The sendrecv2 routine still has a global barrier before the second operation.
Some cleanup and refactoring has been performed. The shmem_buf_t structure
has an init and done functions, and the interface to the event mechanism is simpler.
Tested with 4p.