Directional limits on persistent gravitational waves using data from Advanced LIGO's first two observing runs