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>
fdisk: do not allow writing to a read-only device

Print a warning instead. This fixes the aforementioned "Bad file
descriptor" issue when writing to read-only completely.

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