Deciding the finiteness of the number of simple permutations contained in a wreath-closed class is polynomial