Structural signatures of the insulator-to-metal transition in BaCo1−xNixS2