Aims to fix #23589. Host and port validation on torcontrol, same logic is being used on the other flags which need this validation as well.
This is my first PR for bitcoin core and came across this good first issue, continued on already existing code for this issue.
Took some inspiration from this comment