Quins edge Wasps in thriller