Residual-based tests for cointegration in models with regime shifts