Boot: Add Python2.7 support for post build steps

These minor changes make Python 3 and Python 2.7 verions supported by
the post build scripts, even integrating them as modules.

Change-Id: I0d7a6d95764db082bbec02b0af01da4cf03fd98d
Signed-off-by: Gabor Kertesz <gabor.kertesz@arm.com>
diff --git a/bl2/ext/mcuboot/scripts/assemble.py b/bl2/ext/mcuboot/scripts/assemble.py
index b8b60eb..9c48092 100644
--- a/bl2/ext/mcuboot/scripts/assemble.py
+++ b/bl2/ext/mcuboot/scripts/assemble.py
@@ -67,6 +67,7 @@
 
     def add_image(self, source, partition):
         with open(self.output, 'ab') as ofd:
+            ofd.seek(0, os.SEEK_END)
             pos = ofd.tell()
             if pos > self.offsets[partition]:
                 raise Exception("Partitions not in order, unsupported")