Fixed parsing of dependency files (.d) to improve sketch build speed

Tested on Windows, this should fix issue #2255.
To be tested on Linux and Mac.

/cc @matthijskooijman