File locking issue fixes.

Closing used streams, delete folder retrying.
WPF support. More retrying.

Added WPF GUI support into compilation.
More retrying on some places.
It seems WPF requires full path to it's assemblies ;(
Since WPF doesn't work on Mono anyway, restricted due to path lookup.