Fix install where "\" is used as path separator (Windows) - #845

Backslashes are special in the replacement argument of preg_replace().
So we shouldn't pass it a full path.  We can still use preg_replace()
to remove a segment at the start/end of a path, then we can concatenate
the new segment(s) ourself.
install rename_folder(): simplify unnecessary preg_replace()