Avoid using raw sql in LinksUpdate.php

Now the IN-List is created by the database abstraction layer.

Change-Id: I5f4ed9213d04ae3eeef07c995e6ca91c0ee717b8