mtd: fix erase handling with partition offset on write