If, however, it should appear to the court that the complaint is unfounded, the defendant shall be dismissed. When, in addition, the court is of the opinion that the proceeding was commenced maliciously without probable cause, it may enter judgment against the complainant for the costs of the prosecution.