[brew] Allow more sophisticated symlink usage

https://github.com/Homebrew/homebrew/issues/26524

Defer trying to resolve absolute path for BREW_FILE_DIRECTORY until
it is required for figuring out the target of BREW_SYMLINK.  This
allows the exported HOMEBREW_BREW_FILE to indicate the logical
location of BREW_FILENAME, and the unexported BREW_LIBRARY_DIRECTORY
to use the physical location.