Amir Khan said he knew he would be in a tough fight after overcoming another setback to defeat Julio Diaz on points in Sheffield.