Improve static load balancing in @parallel

Ensure that static load balancing is as good as possible: each worker
process gets either M or M+1 elements of the input range.

Also fix a bug in preduce() which could cause a bounds exception when
the length of the input range was smaller than the number of workers.