Valgrind fixes

Found a few issues when running valgrind and just starting QGC to the main window and closing it.

There's some additional errors when enumerating serial ports in Qt 5.2.1 that will be fixed in Qt5.2.2: https://bugreports.qt-project.org/browse/QTBUG-37578

Once we merge this batch, I'll run through some more scenarios in valgrind.

Additionally, I'll try and upstream these fixes to the OpenPilot GCS: http://www.openpilot.org/product/openpilot-gcs/