Fix for undefined reference to atexit() function.

Hi, I recently ran into an issue which is present in all branches of the IDE.

The linker fails due to a missing standard library function `atexit()`.
This issue affects all IDE branches I have tested: 
- **1.0.5-r2**
- **1.5.6-r2**
- **1.5.7** using C++11

The problem manifests itself when giving an object with a defined destructor, _static local_ storage duration.

Here are two basic examples of the error:
```C++
void setup(){
  static String s;
}

void loop() {}
```

Its not the String libraries fault, any object that requires implicit destruction causes an error:
```C++
struct Foo{
  Foo(){}
  ~Foo(){}
};

void setup(){
  static Foo f;
}

void loop() {}
```

The fix I propose will allow these examples to compile, and I have tested it on the three versions of the IDE I mentioned above.

I created this patch on the master, can you automatically merge this with 1.5.x, or do I need to make a new pull request?

As a side note, if the function is moved else where, it must be declared `extern "C"`. This is taken care of by Arduino.h

Fixes #1919