Fix problem with postgres connections leaking

This was (I think) caused by the upgrade to a newer pg library. In the olden
days, when using a connection pool, a client had to emit 'drain' once it was
done. Now it seems that you need to call the 'end' method.