Fix calculate_relative_path
When outdir == "." calculate_relative_path was counting that dot as a directory and adding an extra ".." to the result. So only count parts that don't equal ".".
Refs #2921