[GWP-ASan] Move random-related code in the allocator (redo)

This is a redo of D89908, which triggered some `-Werror=conversion`
errors with GCC due to assignments to the 31-bit variable.

This CL adds to the original one a 31-bit mask variable that is used
at every assignment to silence the warning.

Differential Revision: https://reviews.llvm.org/D89984

GitOrigin-RevId: 3580a45014e90a9895cc2dec28ab2e7f78c47470
6 files changed