Swap head/tail on "up" links

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