Add barriers to test to prevent segfaults

One barrier after object creation to ensure objects are
created on all ranks before attempting to use them.

Before shut down, add a barrier to ensure all actions have returned
prior to calling finalize.