Make sure dwim'd relative path ends in a "/" if the original does

Fixes #7296