St Johnstone extend unbeaten run with Dundee United win