librbd/internal.cc: check earlier for null pointer

Fix potential null ponter deref, move check for 'order != NULL'
to the beginning of the function to prevent a) deref in ldout() call
and b) to leave function as early as possible if check fails.

[src/librbd/internal.cc:843] -> [src/librbd/internal.cc:865]: (warning)
 Possible null pointer dereference: order - otherwise it is redundant
 to check it against null.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
os/KeyValueStore.cc: fix possible null pointer deref warning

Add assert check for header->header and remove redundant 'if'
check for header again later.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>