Full regularity of the free boundary in a Bernoulli-type problem in two dimensions