Fix #11746: Popover overflows if it is close to the right

https://github.com/twbs/bootstrap/issues/11746