active_record: performance improvements

* Speed-up where queries by caching quoted values and by-passing Rails' sanitization stack
* Wrap response and transaction creation in a single transaction (speeds up the happy path)

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>