The effects of density extremum and rotation on the onset of thermal instability