Select and resequence reveals relative fitness of bacteria in symbiotic and free-living environments