Top Pakistan court allows military trials in terrorism cases