off-duty cop kills home intruder who posted online threats, police say