memif: refactor descriptor handling in the input node