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.