errno is saved into a local variable to avoid it getting trampled
by perror before it is checked to determine the return value.
This issue seems quite rare, but I have seen it when running sfdisk
via gksudo and using the --quiet command-line option. From what I
can tell, this combination triggers loading of translations in perror,
which (at least on my machine) ends up changing the value of errno.
Signed-off-by: Forest Bond <forest@alittletooquiet.net>