log: fix use-after-free in 47dfcb7bab4bc06c1d2186604ca6385c7ad32884

Causes pettycoin to segv (generator logs).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>