Man pleads guilty to gun charges in botched probe