Pool DB connections

Not sure why I get strange DB errors, might be related to use after free or maybe connection pooling. This seems to fix it for now.