piano: Generic linked lists

Introduces generic linked list structure and functions (like append,
delete, …). Removes a lot of copy&pasted code and improves code
readability/reusability.

Heads up: This change breaks libpiano’s ABI.
waitress: Try all addresses returned by getaddrinfo

Fixes issue #384.