Synchronize construction of TApplication

It was possible for multiple threads to attempt construction of a
TApplication or for one thread to think the TApplication was already
constructed while another thread was in the process of doing the
construction.
Merge pull request #39 from Dr15Jones/lockConstOfTApplication

Synchronize construction of TApplication