[MTD] Only call mtd->sync() method in mtdchar close if opened for write.