fdisk: warn if opening a device in write mode failed

Otherwise, `fdisk` fails silently with "Bad file descriptor" when
writing the partition table.

Signed-off-by: Maciej Małecki <me@mmalecki.com>