shared: add format helpers for printing MAC addresses

Use these in networctl.