libperfmgr: Remove request when returning 0ms

There is a small chance a request expire time is less than 1ms. In this
case, the request will be removed.

Test: libperfmgr_test

(cherry picked from commit 09fbfae2d8c3a9d2d071bbd8a29d3ffd46e0f13d)

Change-Id: I1928be09e40302f6aa949dab920cd6aa08dac014
diff --git a/libperfmgr/RequestGroup.cc b/libperfmgr/RequestGroup.cc
index 1c7a96a..7f7ddf4 100644
--- a/libperfmgr/RequestGroup.cc
+++ b/libperfmgr/RequestGroup.cc
@@ -47,16 +47,13 @@
 
     bool active = false;
     for (auto it = request_map_.begin(); it != request_map_.end();) {
-        if (it->second <= now) {
+        auto duration = std::chrono::duration_cast<std::chrono::milliseconds>(
+            it->second - now);
+        if (duration <= std::chrono::milliseconds::zero()) {
             it = request_map_.erase(it);
         } else {
+            *expire_time = std::min(duration, *expire_time);
             active = true;
-            auto duration =
-                std::chrono::duration_cast<std::chrono::milliseconds>(
-                    it->second - now);
-            if (duration < *expire_time) {
-                *expire_time = duration;
-            }
             ++it;
         }
     }