Add NULL checks in fdb_get_metaonly

Avoid segmentation fault if the input parameters
handle or doc is NULL