On optimal regularity of free boundary problems and a conjecture of De Giorgi