Lorenzo just misses out on pole