Handle port aliases & validate port on use (2 of 2)

Anyterm settings accept textual input for the port (useful: an alias can be specified, e.g., for fw ACL rules). 

However the code used to make the subsequent connection errors out nastily if an alias or non-port is used, since it assumes $port exists, is valid, and is already numeric -- but none of these are necessarily true, should assume and check "in case" that data is meaningful before slapping it into a URL. Similar issue exists in server code ($anytermd_command = ...) and also fixed there. 

Tested, works.

Effects of patch:

1) explicitly check that a port is defined;
2) handle textual data such as port alias and validate value obtained (numeric 1-65535) within both server and client code
3) provides at least rudimentary error handling for invalid data (like Unbound, an attempt to use the functional tab if data is bad, returns the user to the package "Settings" tab instead).


NOTE - there is a small alias handling issue revealed by this - if you define an alias "AnytermPort" as port 999, then the contents of $config['aliases']['AnytermPort'] is left padded with spaces ("  999" not "999"), and filter_expand_alias() returns this value, which then fails (is_numericint($port) && $port <-=65535). Workaround - using intval() first, as the fix for this is in alias handling not here.