Fix nested closures unserialize error

Added this condition to correctly parse nested closures (test added). It should be equal to 2, to read main closure directly from stream.