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.
*** failed to import extension badext: bit bucket overflowhg help [COMMAND]show help for a command, extension, or list of commands