Improve exception handling of pico container lifecycle