A generalized eigenproblem approach to singular control problems. I. LQG problems