Fix file descriptor leak on finishing bg tasks

Thanks to anonymous from linux.org.ru.
Remove useless declaration of add_background_job()

It's a duplicate of the exactly same declaration in the background.h
file.
Extract job_free() function in background.c

Frees resources allocated by the job as well as the job_t
structure itself.
Extract set_sigchld() in background.c

Blocks/unblocks SIGCHLD signal.
Extract job_check() function in background.c

Checks status of the job.  Processes error stream or checks whether
process is still running.
Merge branch 'fix-file-descr-leak'

Fix file descriptor leak on finishing background tasks.

Thanks to anonymous from linux.org.ru.