BUG SQLite database connection not closed properly

This was found when performing a load test using HHVM, the sqlite
connections weren't being closed properly so it would throw an
error "Too many open files..." after a number of concurrent
connections were opened.