Add spec for changing $LOAD_PATH during Autoload

Extracted from #2623
Fix loading autoload when $LOAD_PATH changes

This explicitly tracks whether we've attempted to load the file already
so we do this only once. Before this depended on the require returning
false since the file was already loaded. This logic doesn't work if
$LOAD_PATH changes result in a different file being loaded.

This was happening with the new gemified stdlib, because 'pathname.rb'
was available both in lib/ and in the gem after loading the gem changed
$LOAD_PATH.

Fixes #2623