Fixed direction in the config function

change the code in Line 95:
self.direction = self._readandchangepin(MCP23017_IODIRA, pin, mode)
to 
self.direction |= self._readandchangepin(MCP23017_IODIRA, pin, mode)