British number one Johanna Konta produced a superb battling display to reach the Miami Open semi-finals with victory over Romania's Simona Halep.