be more careful with half-opened date_range
closes #11804 

This changes the definition of 'left' and 'right'. If the generated_dates are strictly within (start, end), then changing the value of closed has no impact. Before the code would always remove the leftmost date or rightmost date independently of the value of start and end.

need some tests for this. pls use all of the examples that you provided on gitter.
 lgtm. can you add a whatsnew note (bug fixes), and squash. ping when green.
 @jreback done. I wasn't sure if there is a specific order for the whatsnew notes, let me know if I didn't do it right. Thanks.
 @thrasibule thanks! no specific order in whatsnew, best to put it in the middle somewhere as that tends to not cause merge conflicts (and the reason I leave space for it)
 Thanks for merging!
