Thiem ends Federer's Stuttgart campaign