Phase instabilities in semiconductor lasers: a codimension 2 analysis