1: add freebsd support on current_executable_path().

2: fix build on macosx.
3: remove hardcode /proc/self/exe.