Freebsd support redux

This pull request is based on the work done by @wathiede a long time ago (originally: https://github.com/pyinstaller/pyinstaller/pull/1), plus some additions of my own. I refreshed the original patch to match the current codebase (which had changed considerably) and addressed the concerns that had led to the original pull request not getting merged.

ps. since the original commit was against a now outdated codebase and I had to update the original patch I had to choose how: in this pull request I decided to rebase the original commit, preserving the original author's name while actually creating a new commit. If this is a problem I would be glad to submit a new pull request with the rebased commit crediting me instead.