Rafael Nadal made it 22 wins from 23 matches this season with a nail-biting win over David Goffin at the Madrid Open on Thursday.