bpo-37412: Fix os.getcwd() for long path on Windows (GH-14424) (GH-14451)

* Fix test for integer overflow.
* Add an unit test.
(cherry picked from commit ec3e20a2d1edddb0558f9d32e2b367904ccdde88)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2 files changed