Hamilton takes pole at SPA