Alex Salmond resigns as Scottish first minister