Adding guard for promises returning themselves when processing generic thenables