Update directory detection for get_unstaged_changes for Python 3 - fix #684
The exception raised when trying to read a directory changed from an IOError
in Python 2 to an IsADirectoryError in Python 3 (IsADirectoryError is a
subclass of OSError).
IsADirectoryError doesn't exists in Python 2 so we have to makes extra hops
to have a check compatible with both Python 2 and Python 3.