test: Use ephemeral ports for test apps

Uses PORT=0 for tests to use ephemeral ports for test servers and
makes sure the test apps are updated to report the port they are
actually listening on instead of the port they are configured to
listen on, since 0 indicates that the OS should assign a random
port.

Closes #8