Fix deadlock in application_controller

When using init:stop/0,1, the application_controller waits for its application
to finish. This is done using a blocking receive with an optional timeout. If
no timeout is given, this can lead to a deadlock when an application calls
application:load/1,2. This patch fixes this by dismissing any gen_server call to
application_controller when application_controller is currently shutting down.