qseecom: Add checks for API called in IOCTL

Ported from QCOM commit eb8377a745 : Validate the inputs.

Change-Id: Icb00ed70129b1c7511fb5652c44867cd36c0a500
Signed-off-by: wljv10 <wljv10@motorola.com>