Stable solitary waves with prescribed $L^2$-mass for the cubic Schr\"odinger system with trapping potentials