fix mdbq::Client::get_best_task()

BSON objects returned by cursors become invalid after next batch is
fetched. see documentation of mongo::DBClientCursor::next().
make mdbq::Client::get_best_task() more resilient

use mongo::DBClientCursor::nextSafe() to detect server errors
Merge pull request #2 from bwaldvogel/master

fix and improve mdbq::Client::get_best_task()