Fix ut memleaks

There were a couple memory leaks in my unit test wrapper code.

These are not memory leaks in the pios code, just in my mock flash layer.  Oops.

@lilvinz it is remotely possible that this caused your issues running the unit tests on windows.  Could you retest this branch?