Fix parse_doc() to return GPG_ERR_BAD_DATA upon failure.