Fix nipapd sqlite file leak

An open instance in the main thread prevented others from being closed.