Check whether a given job directory is valid.