Swap head/tail on "up" links

Previous change for redmine #1822 left head/tail labels on the wrong ends for devices in the "up" direction.