Use persistent connection for links database

Add close method to Runtime and Server to make sure
that any underlying connections are cleaned up
Merge pull request #2344 from dotcloud/links-dbconn

Use persistent connection for links database