Multiple WHERE IN on multiple columns
As I understand you want to check each combination of a/b and i_id/o_id

then simple rewrite to join is like this:

SELECT a, b 
  FROM links
  JOIN t_i ON (a = i_id OR b = i_id)
  WHERE id = x
UNION
SELECT a, b 
  FROM links
  JOIN t_o ON (a = o_id OR b = o_id)
  WHERE id = x


But for good index usage I suggest splitting it once more. It is even longer query but can be really fast even on bigger data with indexes on t_i(id,i_id), t_o(id,o_id) links(a) and links(b)

SELECT a, b 
  FROM links
  JOIN t_i ON (a = i_id)
  WHERE id = x
UNION
SELECT a, b 
  FROM links
  JOIN t_i ON (b = i_id)
  WHERE id = x
UNION
SELECT a, b 
  FROM links
  JOIN t_o ON (a = o_id)
  WHERE id = x
UNION
SELECT a, b 
  FROM links
  JOIN t_o ON (b = o_id)
  WHERE id = x