Almost periodic factorization of some triangular matrix functions