sdk: Avoid NPE when receiving null lists

Currently we don't check if the received list of headers is null, and
this causes a NPE.

Change-Id: I5a844fb0e69330a7b1f3949802f016a27391b113
Bug-Url: https://bugzilla.redhat.com/1119812
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
(cherry picked from commit ced0ae61b470c8de1837d60c7e45b4806c7a4575)