Guard against sys.getfilesystemencoding() == None (#503)