dpi: Fix wait_barrier() and test

- wait_barrier() has been changed to function from ClassMethod.