db_hlr.c: add db_subscr_exists_by_imsi()

Check if a subscriber exists without generating an error log entry if
it does not. This is cheaper than db_subscr_get_by_imsi(), as it does
not fetch the subscriber entry. subscriber-create-on-demand will use
this function.

Related: OS#2542
Change-Id: I63818c0dd4fd22b41dadeeba2a07a651b5454c54
diff --git a/tests/db/db_test.err b/tests/db/db_test.err
index 979562e..0701089 100644
--- a/tests/db/db_test.err
+++ b/tests/db/db_test.err
@@ -93,6 +93,13 @@
 }
 
 
+--- Check if subscriber exists (by IMSI)
+
+db_subscr_exists_by_imsi(dbc, imsi0) --> 0
+
+db_subscr_exists_by_imsi(dbc, unknown_imsi) --> -ENOENT
+
+
 --- Set valid / invalid MSISDN
 
 db_subscr_get_by_imsi(dbc, imsi0, &g_subscr) --> 0