ospf6d: Route locking (memory) cleanup

* ospf6_route.c: (ospf6_route_best_next) Allows unlock route, even
  when there's no next route.  This is consistent with how
  ospf6_route_next() behaves.

* ospf6_intra.c: (ospf6_intra_prefix_lsa_remove) Make sure the last
  route considered is always unlocked.  This is needed when the for
  loop terminates because ospf6_route_is_prefix() returns zero.

Signed-off-by: Vyacheslav Trushkin <me@dogonthesun.net>
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index 2d02710..398acfa 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -690,6 +690,8 @@
   struct route_node *rnode;
   struct ospf6_route *next;
 
+  ospf6_route_unlock (route);
+
   rnode = route->rnode;
   route_lock_node (rnode);
   rnode = route_next (rnode);
@@ -701,7 +703,6 @@
 
   assert (rnode->info);
   next = (struct ospf6_route *) rnode->info;
-  ospf6_route_unlock (route);
   ospf6_route_lock (next);
   return next;
 }