Check if open_basedir is set

The file:// protocol does not work with curl when an open_basedir is set.

This fixes #12016

@bantu @MorrisJobke 
Always, because in this way we can document what is in the container available. If you just have the `query()` method you couldn't  look this up in the API documentation or the interface