mtd-utils: add back macOS compatibility code that was dropped during the update