[util] fixed race condition in channel code;