core: fix a messaging bug that caused undefined behaviors

In the beginning, the number of buffers per rank was quite limited.
When mini-ranks or virtual message routing are used, this limit is
increased since message headers are written to re-route information
within the job. However, now some parts of Ray use more buffers because
there was no evolution pressure on this constraint.

This fixes a lot of issues, and probably also an array of issues reported
on the mailing list.

Signed-off-by: Sébastien Boisvert <sebastien.boisvert.3@ulaval.ca>
Link: https://github.com/sebhtml/ray/issues/178
Link: https://github.com/sebhtml/ray/issues/175
Link: https://github.com/sebhtml/ray/issues/134
Reviewed-by: Jean-François Erdelyi <jean-francois.erdelyi.1@ulaval.ca>