Officials: Suspect was hiding in closet before deputy fatally shot him