[SPARK-4075][SPARK-4434] Fix the URI validation logic for Application Jar name.

This PR adds a regression test for SPARK-4434.
Same: validation fails becase URI has no path, not because it doesn't have an authority.