Molecular gas and star formation towards the IR dust bubble S24 and its environs