Entanglement dynamics of a three-qubit system interacting with a quantum spin environment