mtd: nand: refactor BB marker detection