stdio-common: Add lock optimization to vfprintf and vfwprintf