When a surety is released as heretofore provided, the surety shall refund to the party entitled thereto the premium paid, if any, less a pro rata part thereof for the time said bond has been in force.