ipaccess: Fix crash when no IPA message is sent first on the RSL port

The issue was that the link has not been configured yet and the
list has not been initialized yet (it is NULL for next/prev).
Check if the ts is not configured before searching a link.

Reproduce with:
 (Sockets.StreamSocket remote: 'localhost' port: 3003)
	nextPutAll: #[0 1 0 0];
	flush.

Backtrace:
 #0  e1inp_lookup_sign_link (e1i=0x27af8c0, tei=0 '\000', sapi=0 '\000') at e1_input.c:437
 437			if (link->sapi == sapi && link->tei == tei)
(gdb) bt
 #0  e1inp_lookup_sign_link (e1i=0x27af8c0, tei=0 '\000', sapi=0 '\000') at e1_input.c:437

 #1  0x00007f338ee87d49 in handle_ts1_read (bfd=0x27afe60) at input/ipaccess.c:436
 #2  ipaccess_fd_cb (bfd=0x27afe60, what=1) at input/ipaccess.c:586
 #3  0x00007f338f0976ce in osmo_select_main (polling=0) at select.c:158
 #4  0x0000000000407394 in main (argc=<optimized out>, argv=0x7fff1aa4fed8) at bsc_hack.c:346
(gdb) p *e1i
 $1 = {type = E1INP_TS_TYPE_NONE, num = 2, line = 0x222e860, lapd = 0x0, {sign = {
      sign_links = {next = 0x0, prev = 0x0}, delay = 0, tx_timer = {node = {
          rb_parent_color = 0, rb_right = 0x0, rb_left = 0x0}, list = {next = 0x0,
          prev = 0x0}, timeout = {tv_sec = 0, tv_usec = 0}, active = 0, cb = 0, data = 0x0}},
    trau = {demux = {chan_activ = 0 '\000', subch = {{
            out_bitbuf = '\000' <repeats 319 times>, out_idx = 0, consecutive_zeros = 0,
            in_sync = 0}, {out_bitbuf = '\000' <repeats 319 times>, out_idx = 0,
            consecutive_zeros = 0, in_sync = 0}, {out_bitbuf = '\000' <repeats 319 times>,
            out_idx = 0, consecutive_zeros = 0, in_sync = 0}, {
            out_bitbuf = '\000' <repeats 319 times>, out_idx = 0, consecutive_zeros = 0,
            in_sync = 0}}, out_cb = 0, data = 0x0}, mux = {subch = {{tx_queue = {next = 0x0,
              prev = 0x0}}, {tx_queue = {next = 0x0, prev = 0x0}}, {tx_queue = {next = 0x0,
              prev = 0x0}}, {tx_queue = {next = 0x0, prev = 0x0}}}}}}, driver = {misdn = {
      fd = {list = {next = 0x7f338f2a7950, prev = 0x250f890}, fd = 19, when = 1,
        cb = 0x7f338ee87c40 <ipaccess_fd_cb>, data = 0x27af2c0, priv_nr = 2}}, ipaccess = {
      fd = {list = {next = 0x7f338f2a7950, prev = 0x250f890}, fd = 19, when = 1,
        cb = 0x7f338ee87c40 <ipaccess_fd_cb>, data = 0x27af2c0, priv_nr = 2}}, dahdi = {fd = {
        list = {next = 0x7f338f2a7950, prev = 0x250f890}, fd = 19, when = 1,
        cb = 0x7f338ee87c40 <ipaccess_fd_cb>, data = 0x27af2c0, priv_nr = 2}}, rs232 = {fd = {
        list = {next = 0x7f338f2a7950, prev = 0x250f890}, fd = 19, when = 1,
        cb = 0x7f338ee87c40 <ipaccess_fd_cb>, data = 0x27af2c0, priv_nr = 2}}}}
1 file changed