TRQ-2845: Fixed tmp_time math in mom_main main loop

Fixed tmp_time math
Moved the logic to a function
Wrote a unit test
TRQ-2411: print the header only once

- added global variable print_header for indication "need print header"
TRQ-2411: error info prints on bottom of output

Conflicts:

	src/cmds/qstat.c
TRQ-2411: remove unused comments
TRQ-2411: add unit test for checking get_err_msg; change format of err string

- fix in get_err_msg(): change convertion from int to string
- add unit test
TRQ-2814: changed job_exclusive_onuse to job_exclusive_on_use.
Merge pull request #251 from DSRCompany/TRQ-2845_wrong_time_now_math

TRQ-2845: Fixed tmp_time math in mom_main main loop
TRQ-2292: Properly calculate tasks count from nodes resource.