Add unittest for detach interface with no local port id case

1. Fix the previous unittest issue
2. Add test case to check no local port id found

Change-Id: I95674b45a6db64359a1d8a47bfc5aa367ab8594d
(cherry picked from commit 2919c4ef2865d6fb4324e5ceadf96496e38b3ee7)