St Mirren boss Danny Lennon was left to rue Jim Goodwin's sending off during their home defeat to Dundee.