Replace the global variable ambapp_plb with a function to allow an automatic on demand initialization.
Update #3678.