Only raise rollback errors when inside transactions

Fixes #192.