First-principles study of hydrogen ordering in lanthanum hydride and its effect on the metal-insulator transition