Fix build errors caused by making sqlite keg_only

- In subversion and gdal, because they used
  HOMEBREW_PREFIX/lib instead of
  Formula.factory('sqlite').opt_prefix

Closes #17005.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>