Fix a misuse of function pointers

Function names themselves are the entry point or address of their
bianry code, therefore function names themselves are function
pointers already, the same as array names.

As a result, a function name instead of its address should be
directly assigned to another function pointer.
Sanity check on the "-n" option of the historyQuery handler

The oBIX server can't take it for granted that "-n" option carries
a positive value. In previous implementation, if "-n 0" is passed
then the logic in historyQuery handler flows until segfaults.

Therefore negative values or zero value should be handled carefully.
For sake of convenience of oBIX clients, if no "-n" option or a
negative value such as "-1" is used, then all existing records are
considered. Furthermore, if "-n 0" is used, then the handler returns
the timestamps for the first and last records for relevant device so
that oBIX clients can get the end timestamp conveniently instead of
having to query all existing records.