How do Aether Rift and Library of Leng interact?
He would be able to put a card on top of his library in order to not lose, but not quite the way you are thinking it works.

What happens is a the beginning of your opponent's upkeep Aether Rift's ability goes on the stack, and when it resolves they discard a card at random. when the card gets discarded Library of Leng's replacement effect occurs allowing your opponent to put the card on top of their library. If they chose to put the card on top of their library the rest of Aether Rift's ability doesn't apply since as far as the game knows a creature card was never discarded (a card was discarded if anything else cares about that, but nothing is known about that card, including its type [CR 701.7c]). Your opponent will then draw the card they just "discarded" at the beginning of their draw step. They can keep repeating this process until you run out of cards in your library.