Search for the isotropic stochastic background using data from Advanced LIGO's second observing run