added a retry mechanism for dealing with slaveOk = false #840

fixes #840