prevent possible race condition when removing db pid from the registe…
should fix #60 (closed) . right now the system is still messy as the database state is maintained as 2 places in ETS and in the db process. This should change soon to be maintained