Fix check whether PE file is a debug build for MinGW

Use code inspired by objdump / pfd library to decide
whether a MinGW PE file is a debug build, or not.

Task-number: QTBUG-38160
Change-Id: If6b6136238eb7962a948ea7168fb3a8f8f87e323
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>