An autonomous quantum machine to measure the thermodynamic arrow of time