[ty] Watch script dependencies in the language server (#28522)
## Summary
Same as https://github.com/astral-sh/ruff/pull/28125 but for the server.
The main difference to the CLI is that, up to now, the server did not
support changing its watched paths after its initial initialization.
This PR adds the infrastructure so that the server now supports updating
its watched paths as search paths change.
## Test Plan
**Before**
https://github.com/user-attachments/assets/a6ace5a1-84c9-4acb-a15c-991389543109
Changes to `dependency.py` are not picked up
**Now**
https://github.com/user-attachments/assets/b3d6bf4b-496f-4bdc-a610-82eb9690ffb3