[PATCH 4.14 32/47] bpf: Refactor and streamline bounds check into helper