scanner: Use PATH_MAX, not hardcoded 1024 for realpath()

Otherwise we can overflow the stack on longer pathnames.

Tested-By: Mantas Mikulėnas <grawity@gmail.com>