Make --dep-info escape spaces in filenames

Closes #17627