Glasgow Warriors take a big step towards winning the 1872 Cup for the fourth year running with a bonus-point first-leg victory over Edinburgh at Hampden.