Fixed package build due to failed unit tests

The unit tests failed when building on non x86 architectures
because the test reference files for these architectures
contained an unexpected newline at the end of the file. In
addition subsequent tests should not fail which was the case
because existing test tmpdirs were not correctly cleaned up