Fix for failing replication test

This adds a small fix for the set_replication_worker() function and also makes an addition to the enable_internal_db function to allow fetching of encryption keys from other appliances. This is required for the replication tests since each appliance has its own internal database, but all they share the same encryption key.