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 
Do we have any guideline, when to use this for easy stuff where it just wraps `query()`