Police foils terror bid in Rawalpindi