Handle job reference counter internally

Signed-off-by: Sergey Mironov <grrwlf@gmail.com>