Correct FmConfig parsing and finalizing.

There were some g_free() missing and some bools were not set from defaults.
Make fm_modules_load() thread-safe by calling real load in default main context.
Make FmFile interface thread-safe.
Replace global G_LOCK_DEFINE with static versions.