Entanglement dynamics of two independent qubits in environments with and without memory