Try to fix ProgramTest on FreeBSD

This seemed like the cleanest way to find the test executable.  Also fix
the file mode.