Fix #446. Check for (de)serialization errors

This is caused by goraft not checking for serialization error and
timestamp in the shard being outside the valid range. See
goraft/raft#221 for the pull request that fixes the bug.