oairepository: fix date handling

* Addresses issue with finding min/max date when there are no records in
  the database.

* FIXME check CFG_MAX_DATE and CFG_MIN_DATE constants.

Signed-off-by: Jiri Kuncar <jiri.kuncar@cern.ch>