util: ensure Path is a binary on write