Noiseless signal shaping and cluster-state generation with a quantum memory cell