rm_ improve internal _realpath function