Generalized analysis of quasi-steady-state and quasi-transient measurements of carrier lifetimes in semiconductors