Testing for common cointegrating rank in dynamic panels