Updated test so that it closes connections to make sure that it runs
on platforms where the database connections aren't recycled quickly.
Added missing return on null check in Linkd.
Changed Nms4005Test to use fresh databases per test.