Make function to wrap URL-opening fopen() calls

This is preparatory to rewriting the code to open URLs using
something other than fopen.