Add unittest for appcontext_tearing_down signal

There was no unittest for the appcontext_tearing_down signal, therefore I added one.