This commit fixes and edge case, where testing/benching code could pledge new permission set before restoring the previous pledge. Appropriate panics were added and tests that assert that process is killed in case of "recursive pledge".