Add post-test clear-up to cover close() behaviour and clean-up properly