Fixed #21037 -- Made MigrationWriter raise a ValueError when serializing lambda functions.