Fix problem when pre-loading the working directory history if directories have spaces in their names