Introduces work_queue_submit_internal for foremen.

This commit fixes a bug in which work_queue_submit increased
automatically the taskid in a foreman.  This is incorrect for foreman,
where taskid are set by the master. This commit makes work_queue_submit
a wrapper for a new function, work_queue_submit_internal, which submit
tasks without modifying the taskid.

Without this fix, the taskid at the master and the foreman would be
different. When the foreman reported the task as completed, two problems
were caused:

1) If the master never had such a taskid, it would just ignore the
results from the foreman.

2) Even worse, if the foreman taskid did exits at the master side, the
master would ask to transfer files that did not exist on the foreman.

backport:  Adds q->long_timeout for foreman messages.

This commit fixes a bug in which connections between master and foreman
timed out when the foreman was servicing workers. This created two
problems:

1) The master would re-schedule tasks when file transfers could not be
completed.
2) The master would blacklist the foreman for invalid messages when the
foreman finally answered the original request.

Now when the master talks to a foreman, we use a long timeout (default
3600 s), rathen than the original short one (5 s).

Backport: foreman uses submit_internal
Release workers in wq_reset() instead of just cleaning them up. This is a short
term fix for bug #282.

Conflicts:
	work_queue/src/work_queue.c

Release workers when we disconnect from a master. This clears out the data in
the links and sockets and is a short term fix for bug #282.

Clarify the documentation for wq_reset().

Fixes to previous commit.

- Unused variables.
- Missing prototype.