Bug 721733 - Tweak Berkeley DB detection logic

Make two changes to the logic that we use to find the Berkeley DB:

 - in the default case where --with-libdb is not given, do not attempt
   to add the default ${prefix}/include and ${prefix}/lib to the CFLAGS
   and LIBS.  Only do this if --with-libdb is explicitly given.

 - in the case where --with-libdb is not given, and DB_CFLAGS or DB_LIBS
   is already set, use those values instead of our own guesses

This allows the build to proceed on FreeBSD, where the headers are in an
unusual location and the library has an unusual name.

https://bugzilla.gnome.org/show_bug.cgi?id=721733