Make getline declaration visible to compiler on FreeBSD and probably other systems

From FreeBSD's getline(3):

    Many application writers used the name getline before the getline()
    function was introduced in IEEE Std 1003.1 (``POSIX.1''), so a
    prototype is not provided by default in order to avoid compatibility
    problems. Applications that wish to use the getline() function
    described herein should either request a strict IEEE Std 1003.1-2008
    (``POSIX.1'') environment by defining the macro _POSIX_C_SOURCE to
    the value 200809 or greater, or by defining the macro _WITH_GETLINE,
    prior to the inclusion of <stdio.h>. For compatibility with GNU
    libc, defining either _BSD_SOURCE or _GNU_SOURCE prior to the
    inclusion of <stdio.h> will also make getline() available.
Move linux-specific filepath bits inside #ifdefs