check db privs when deciding how to find_in_batches

previously we relied on the symbol stored in
Shackles.environment; if the environment was :slave
we would use a cursor, otherwise a temporary table.
The problem is there could be multiple slaves (or
connections in general for which the database user
doesn't have the rights to create a temporary table).

This commit has AR ask the database if we have permission
to create temp tables and make the decision based
on that information.

Change-Id: I94e4929874c42f200cf544b71f435be211bfe33b
Reviewed-on: https://gerrit.instructure.com/34263
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>