(d) In appeals from a judgment of the superior court, a housing court or a district court the deposit shall not be transmitted to the appeals court or the appellate division unless specifically requested by said appeals court or appellate division. The superior court, a housing court or a district court may give directions as to the manner of keeping the deposit. Upon final judgment for the plaintiff, all money then due to him may be recovered in an action on the bond provided for in the third paragraph of this section.