s4/libnet: Allocate mem in supplied mem_ctx