Use sys.executable to get script drectory when frozen.

py2exe overwrites sys.path[0], and the paths to the registration
helpers end up wrong. If we are frozen, use dirname(sys.executable)
instead of sys.path[0].