St Helens moved to the top of the Super League after fending off Huddersfield Giants to earn a 18-16 victory on Thursday.