Closing a quantum feedback loop inside a cryostat: Autonomous state preparation and long-time memory of a superconducting qubit