Amazon posted better-than-expected third-quarter profits with revenue up 13% over the quarter while profit margins were at a near-record high.