Fix for race condition in url file decoding.

As evidenced in chapmanb/bcbio-nextgen#163. Python's `open`
creates the file before writing to it, so it's possible for
an engine to read the file before the connection information
has been written, resulting in an error. This commit prevents
this.
Merge pull request #4518 from porterjamesj/master

Fix for race condition in url file decoding.