Shaheen bowls Pakistan to brink of victory