syncop: Remove task from syncbarrier's waitq before 'wake'

Removing task from syncbarrier's waitq after wake could result in a
subsequent syncbarrier_wake, wake'ing up the already running task.  This
fix makes the removal from waitq and wake 'atomic'

The root cause and the fix are similar in spirit to what was observed
in synclock's waitq implementation.

Change-Id: I7dd9e6ad5945742bcda20eb5a06a9376bb18528e
BUG: 948686
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/5047
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>