py3: use pycompat.getcwd() instead of os.getcwd()
We have pycompat.getcwd() which returns bytes path on Python 3. This patch
changes most of the occurences of the os.getcwd() with pycompat one.
ERROR: FIXME: This is a known failure of filelog.size for data starting with \1\nOK.