Don't run the scheduler when running tests
Revert "Close connection before and after executing periodic OCR task, to avoid stale DB connection remaining open. Ref: Issue #4"

This reverts commit ee1e732776fff16e9204c167ac84f34f09d3b202.

73ebc06275ddcf763d6073e47d541a2d990bd69d Supersedes this one, thanks a lot to Mathias Behrle for uncovering this bug and all the help squashing it!