Leave alone fragment-only URLs.

Without this change, mangling such URLs produces invalid results.