Fix potential blocking of stdio pipes for backup/restore