Pass around sketch File objects instead of filenames

This saves a few conversions from File object to String and is generally
cleaner.
Add Base.absoluteFile method

This method takes filenames as specified on the commandline and turns
them into the right File object, taking into account the current
directory passed through --curdir by the wrapper script.
Fix --curdir on Windows

On Windows, files are canonicalized to prevent issues with legacy 8.3
filenames. However, this canonicalization includes making the path
absolute and this happened before applying --curdir to the path, making
the latter a noop.

By reversing the operations, this should allow both of them to do their
work.
Fix opening a non-primary .ino file

When a sketch looks like this:

    Blink/
        Blink.ino
        Foo.ino

The idea is that opening Foo.ino should open up the sketch. However,
before this would show an error stating "The file Foo.ino needs to be
inside a sketch folder named Foo" instead.

This turned out to be due to a typo, which seems to have been present
for a long time. Note that when the main sketch file was a .pde file,
everything already worked as expected.
Apply --curdir to --preferences-file

Previously, specifiying --preferences-file foo.txt would create a
foo.txt file next to the arduino binary, instead of in the current
directory.