A man shot and killed at least 16 people at a restaurant and a bowling alley in Maine and then fled into the night, sparking a massive search by hundreds of officers while frightened residents stayed locked in their homes Thursday under a shelter-in-place advisory.