SERVER-15210 SERVER-15211 SERVER-15382 (v8-3.25) remove OID undefined behavior and make it endian aware.

    fixes v8-3.25 build failure.

Closes #793

Signed-off-by: Benety Goh <benety@mongodb.com>