Self-adjoint problems for nondensely defined ordinary differential operators and their eigenfunction expansions