Throw an ElasticsearchIllegalArgumentException when allocating on a non-data node.

Today, it would fail with a NullPointerException.

Close #4833