Sri Lanka closed the opening day of the second Test on 57-1 after their bowlers had knocked over Pakistan for just 165 in Dubai.