[PATCH 13/48] mtd: properly check all write ioctls for permissions