equivalent change to realpath() error return as was done in master rev 60a9213035d3c