Fixed callback order for pre/post cmd exec hooks.