[PATCHv2] Add timeout to callbacks waiting for enough entropy (#1073679)