mtd: physmap: fix NULL pointer dereference in error path