Maine, John G., Vice-Consul at Tripoli