Same problem on my impreza: the temp switch has an earth return tthrough the diff casing, which in turn is earthed to the rear body earth point via a cable and spade connector onto a tag under one of the rear cover bolts on the diff . This is nicely positioned to catch road spray and corrode to nothing then fall off. The diff can sometimes get an earth throught its mountings, but since they are flexible it depends on the torque through the diff as it moves around, hence the flickering. Renewing the connector and/or the tag should do the trick..