Libya’s combatants are readying for a long conflict, as foreign weapons flood in, tribesmen close oil ports and rival alliances wrangle over revenues from Africa’s largest petroleum reserves.