An invariance principle for triangular arrays of dependent variables with application to autocovariance estimation