Fix TypeErrors when matrix[:hash] is an Array

The validator which asserts that the :allow_failures key must contain a
list of hashes does not check that the matrix is a Hash. This means that
if the matrix is an Array, it fails with `TypeError: cannot convert
Symbol into Integer`.

This commit adds a test demonstrating this behaviour, and fixes the
issue by adding a check in the aforementioned validator, as well as
adding another validator to check that hash[:matrix] is, in fact, a
Hash.