ninja 1.4.0

Fixes #22587.
Open files in binary mode where appropriate