(a) It is the duty of the court or judge to act upon such applications instanter.
(b) A wrongful and willful refusal to grant the writ, when properly applied for, is a misdemeanor in office, besides subjecting the judge to damages at the suit of the party aggrieved.