hal/link/unlink: revise semantics of hal_link()/hal_unlink():

old behavior: a pin's default value would be overwritten by a signal value
on link, effectively making the default pin value invisible outside the
component, and potentially causing a jump in the pin's value on link.

an unlink would re-apply the pin's hidden default value regardless of the
signal value, also causing a potential jump in the pin's value on unlink.

new behavior: the very first link of a signal to a pin will make the
signal inherit the pin's value. On unlink, the pin's default value will
be set from the current signal value.

The result is:
- no sudden jumps in pin values as a result of link/unlink
- it is now possible to access a pin's default value from other pins
- it is possible to have the changed default value retained on unlink

Change of behavior: Code relying on signal values defaulting to zero
post-linking should be revised to consider:

So far, a new signal value defaulted to 0/0.0/false regardless of
the pin's values linked to it.

Now, the signal will inherit the first linked pin's value.

ref: [Emc-developers] PID bidirectional pins. Mar 16 2014
hal/link/unlink: add testcase hal-link-unlink

this test verifies the new semantics.
halcmd: update man page on link/unlink semantic change