Adaptive mesh generation in 2D magnetostatic integral formulations