dirname() corrupts URIs, at least under MinGW.  Closes: #394.