refactor: [index] Replace deprecated char with uint8_t in serialization
Summary:
All char representations are serialized in the same way, however the char one is deprecated. Also, using uint8_t directly avoids casts.
This is a backport of core#21824
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D15933