Add Job's unique_id to test state

Signed-off-by: Cleber Rosa <crosa@redhat.com>
journal plugin: adapat to test state

Since other more standard plugins have moved to test state in a previous commit
the journal plugin should also follow that.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
journal plugin: make code more resilient

In some circurnstances, the journal may be accessed simultaneously by
multiple code paths. The database consistency should be enforced in any
case, and only initialized and populated when appropriate.

Signed-off-by: Cleber Rosa <crosa@redhat.com>