glusterd: use synclock_t for synchronizing concurrent '\op_sm\' invocations
    
    In glusterd_op_sm(), we lock and unlock the gd_op_sm_lock mutex.
    Unfortunately, locking and unlocking can happen in different threads
    (task swap will occur in handler call with use of synctasks).
    
    This case is explictely covered by POSIX: the behavior is undefined.
    http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html
    
    When unlocking from a thread that is not owner, Linux seems to be fine
    (though you never know with unspecified operation), while NetBSD returns
    EPERM, causing a spurious error in tests/basic/pump.
    
    To fix this, we use synclock_t which was precisely meant for this.
    synclock is a pthread_mutex_t like synchronization object which uses the
    synctask handle for owner and is immune to the task being run on
    multiple threads during its lifetime.
    
Change-Id: Idca15190d42f32a843088cc8236138f676377586
BUG: 1129939
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/9212
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Kaushal M <kaushal@redhat.com>