A severely-depleted Glasgow Warriors survived a nervy last few minutes to secure a 22-19 win over Connacht at Scotstoun in the URC.