The costs of the application, if unsuccessful, shall be paid by the applicant; if successful, by the principal, and judgment may be given and execution issued therefor.