AS7-6739 Execution order of lifecycle interceptors incorrect

This PR replaces https://github.com/jbossas/jboss-as/pull/4239
There is a small change needed even after Stuart's changes. In addition this PR contains a test case.