Fix handling of `sys.base_prefix` collision in interpreter identity check during tool installs (#7596)
Closes https://github.com/astral-sh/uv/issues/7586
Extends https://github.com/astral-sh/uv/pull/7593 (thanks @lucab!)
---------
Co-authored-by: Luca BRUNO <lucab@lucabruno.net>