Elastoresistive and elastocaloric anomalies at magnetic and electronic-nematic critical points