Don't serialize extra whitespace at the end of a meta file

Differential Revision: https://phabricator.services.mozilla.com/D118162

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1710605
gecko-commit: 4ee05dc03d18644efbc03f017c346b27580d6dda
gecko-reviewers: whimboo
diff --git a/tools/wptrunner/wptrunner/wptmanifest/serializer.py b/tools/wptrunner/wptrunner/wptmanifest/serializer.py
index 3fc39a4..e31a607 100644
--- a/tools/wptrunner/wptrunner/wptmanifest/serializer.py
+++ b/tools/wptrunner/wptrunner/wptmanifest/serializer.py
@@ -33,6 +33,7 @@
         rv = "\n".join(self.visit(root))
         if not rv:
             return rv
+        rv = rv.strip()
         if rv[-1] != "\n":
             rv = rv + "\n"
         return rv