Robust inference for threshold regression models