Man shot in the leg while sleeping in apartment, police say