Clean up port forwarding code

Clean up port forwarding code in preparation for VirtualBox support.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>