Metal-insulator transition in the Hubbard model with incommensurate magnetic structures