use ConnectionManagement middleware to close database connect

The development log will show warning like

```
DEPRECATION WARNING: Database connections will not be closed automatically, please close your database connection at the end of the thread by calling close on your connection. For example: ActiveRecord::Base.connection.close'
```

It can be resolved by adding a middleware `ActiveRecord::ConnectionAdapters::ConnectionManagement`.

The relative discussion is http://stackoverflow.com/questions/10191531/activerecord-connection-warning-database-connections-will-not-be-closed-automa