Check boundary undefined with non-default close parameter for date_range
#### Code Sample
```python
import pandas as pd
```
```python
print(pd.date_range(start="2018-10-17", periods=7, closed="left"))
print(pd.date_range(start="2018-10-17", periods=7, closed="right"))
print(pd.date_range(end="2018-10-17", periods=7, closed="left"))
print(pd.date_range(end="2018-10-17", periods=7, closed="right"))
```

#### Problem description

There is a check in the code that should not allow this cases. It raises a `ValueError`. The `if`condition is bugged and thus this check is not being processed. This was found while investigating #23176.

Note: this issue is not debating wether allowing or disallowing `closed` differents to `None` for only partially bounded `date_range`es (understanding partially bounded as only one of `start` and `end` provided). It is just pointing out that the current code is skipping a check.

#### Expected Output
1:
```python
ValueError("Closed has to be None if not both of startand end are defined")
```

2:
```python
ValueError("Closed has to be None if not both of startand end are defined")
```

3:
```python
ValueError("Closed has to be None if not both of startand end are defined")
```

4:
```python
ValueError("Closed has to be None if not both of startand end are defined")
```

#### Output of ``pd.show_versions()``

```
python: 3.6.4.final.0

pandas: 0.23.4
```