avoid use-after-free in raft.c
Revert "Revert "fix rub to crash gracefully upon decoding invalid data""

This reverts commit 8c87faf180e00c582b01f7c4e82b77b17933596a.

The previous use-after-free fix appears to alleviate the crash "caused"
by this code.