The TAP free energy for high-dimensional linear regression