Fix realpath_relation to consider os.sep and os.altsep.