Defect migration in methylammonium lead iodide and its role in perovskite solar cell operation