fix wrong order of frees in chancreate
fix incorrect behaviour of unbuffered send/recv