Fix open/close tests for memory databases