buffer: fix 6-byte writeUIntBE() range check
Fixes: https://github.com/nodejs/node/issues/30420
CI: https://ci.nodejs.org/job/node-test-pull-request/26530/
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines