Fix extend_query_by_date function if it raises an error

@jone 

- Fix extend_query_by_date function if 'datestring' contains a  bad date-format.
  The function is to extend a query (dict) with a daterange and returns the new
  query. If the function can't convert the datestring to a datetime object, it
  returns None and the given query is lost.
  Now the function returns the untouched query.

- Also fix the bad test for this case.