Fix a couple of bugs in the database pool

I found these issues while I was using this same database pool in
my other project smnl.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>