Sri Lankan president confirms he will resign, PM's office says