Add endswithsep() and use it instead of using os.sep and os.altsep directly.
This change is intended to allow hooking endswithsep() by win32mbcs
extension for MBCS support.
abort: Failed to parse .../t/.hg/hgrcFile contains no section headers.file: .../t/.hg/hgrc, line: 1'invalid\n'