Replicator DB: fix a rare gen_server death case. Happened when the rep_db_created message is received before the changes loop dies. Also simplified a bit the handling of subprocesses exits.