Khan threw it away.
It was a really entertaining fight to watch, and a one that I'd have scored in favour of Khan had it not been for the silly fouls and spoiling. The ref got the deductions spot on IMO and Khan has only himself to blame for the result.