Merge pull request #1374 from jonathanwright-ARM/jw/fix-memory-leaks-in-fiptool

Fix memory leaks in fiptool