inreplace: Open the file as binary

Closes #22628.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>