Density of states and supercurrent in diffusive SNS junctions: Roles of nonideal interfaces and spin-flip scattering