Finite-time Analysis of Approximate Policy Iteration for the Linear Quadratic Regulator