Every court before which any person shall be convicted of an offense less than a felony may, in addition to the penalty prescribed by law, require the convict to enter into bond in a reasonable sum, with or without sureties, to keep the peace and to be of good behavior for any time not longer than two years, and may order him to stand committed until such bond be executed; and for any breach thereof it may be proceeded on by scire facias as in other cases.