Pakistan stocks close 40 points up following profit-taking