Close connection before and after executing periodic checkin task, to a...

...void stale DB connections remaining open. Ref: Issue #4

Completes https://github.com/mayan-edms/mayan-edms/commit/ee1e732776fff16e9204c167ac84f34f09d3b202