mtd: mtdblock: call mtd_sync() only if opened for write