C++: Prevent access to wrong path when RAYS_HOME is not available

This is also good for backward compatibility.