[PATCH 5/8] removeaport(): fix segfault when there are no ports to remove