Re-introduced ftls dynamic.

The patch is adapted from the one for the previous version of Geant4.
See also #265 and #457.