Hamilton masters wet conditions to take pole at F1 Chinese GP