build: add leak checking in tests