Fix for broken shutdown with embedded neo4j db

@tomasmuller Like promised here it is :)