Fix: piqi to-proto incorrectly handling aliases in some cases

Alias pointing to an imported record which field has an imported type was
handled incorrectly.
Build improvements and fixes for Windows/MinGW build