Moved logic of Channel#sync into SyncHelper and added SyncHelper#wait