tests: add support for Minitest versions < 5

Minitest versions 4 and below do not support the newer Minitest::Test
class that arrived in version 5. Use MiniTest::Unit::TestCase as a
fallback.