socket: add boundary checks for iobuf_get2 over rpc_hdr_bytes

A malformed packet can cause a OOM while peforming iobuf_get2()
on a large enough packet side.

Such a scenario is observed when running vulnerability tests,
it would look like one of those tests perhaps based on DDOS (Denial
of Service) attacks hand-crafts a RPC packet which is of a large
enough size - since we do not verify the size and do not provide
any boundary checks, there are secenarios where it leads to OOM.

Reproducible consistently with those tests has revealed that we
should be ideally be adding a boundary check.

Limit such an allocation to a 1gigabyte, as it might be sufficient
to handle for all variety of RPC packets.

Change-Id: I5f1411dd96d6f167993d28a1718ffef2fb4e9923
Signed-off-by: Harshavardhana <harsha@harshavardhana.net>
Reviewed-on: http://review.gluster.org/8384
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Tested-by: Raghavendra G <rgowdapp@redhat.com>