Lewis Hamilton 'in advanced talks' to join Ferrari as shock clause emerges