If the sentence imposes a fine only, without imprisonment for nonpayment, and the defendant is not detained for any other legal cause, he shall be discharged as soon as the sentence is pronounced.