Apply upstream commit to fix loading remote modals

Applies [this commit](https://github.com/alexhayes/bootstrap/commit/3edf995711bd7391bbe3d583b38e959f4e75974d) to fix loading remote modals.