Register quit listener at early stages of Grain launch
Signed-off-by: Dmitriy Pavlenko <dmitriy.pavlenko@sysgears.com>