Perth snatch Origin game away from NSW